Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Facebook Action Links

I guess there's no way to add Action Links to a facebook post on iphone?
http://wiki.developers.facebook.com/index.php/Facebook_Connect_for_iPhone#Publishing_Feed_Stories_to_the_Stream

— asked April 14th 2010 by James Low
  • facebook
0 Comments

3 Answers

  • I just used publish_stream in my app and got it working. I have not tested Action Links yet but plan on doing so.

    As you can see from the link below, the "Action Link" belongs in the data argument.

    https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Facebook.publishStream.html

    For help with setting up a string that fits with the data rules, here is a better explanation from facebook:

    http://developers.facebook.com/docs/?u=facebook.jslib.FB.Connect.streamPublish

    All in all, try adding this code and let me know if it works!

    //setup alert
    var a = Titanium.UI.createAlertDialog({title:'Facebook'});
    a.addEventListener('click', function()
    {
        win.close();
    });
    
    //code to publish stream
    
    //here is your attachment
    var attachment = {'media': [{'type':'image',
                                 'src':'http://bit.ly/AJTnf',
                                 'href':'http://bit.ly/hifZk'}]};
    
    //this is a message that pops shows above the text box, it doesn't have any effect on the published stream as far as i can tell
    var msg =  "Write your message in the box below";
    
    //leave this variable null if you want to post to your own wall, else this is the persons wall you are posting to
    var fbid = 1111;  
    
    Titanium.Facebook.publishStream(msg,attachment,fbid,function(r)
    {
        Titanium.API.info("received publish stream response = "+JSON.stringify(r));
        if (r.success)
        {
            a.setMessage('Your stream was published!').show();
        }
        else
        {
            a.setMessage('Sorry, we encountered an error.').show();
        }
    });
    
    — answered April 14th 2010 by Ryan Gartin
    permalink
    2 Comments
    • Is this still working? I had no luck. Did FB change st in the meantime ,,,?

      — commented December 22nd 2010 by Ralf Klotzbuecher
    • Is it necessary to make human intervention for type something? How can I post link to my facebook wall by just clicking a button?

      — commented February 1st 2011 by Manaday Mavani
  • Yea I've got the publish stream working, but from the facebook connect for iPhone documentation in seems you can't use action links.

    — answered April 14th 2010 by James Low
    permalink
    0 Comments
  • Action links don't work not supported by Facebook for the iPhone client unless you use an HTML share link.

    — answered April 28th 2010 by James Low
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.