how to show ''+Ti.Facebook.uid+'/name' as a string

You must Login before you can answer or comment on any questions.

hi guys

how to show a url ==> ''+Ti.Facebook.uid+'/name', as a string (so the username from the person who has logged in with FB)

same idea as showing a picture ==> var profileView = Ti.UI.createImageView({ image:''+Ti.Facebook.uid+'/picture', });

— asked 3 years ago by Napp Dev

1 Answer

var label = Ti.UI.createLabel({text: ''+Ti.Facebook.uid+'/name'});

— answered 3 years ago by Stephen Feather
answer permalink
  • hi stephen,

    i tried this already and it does not show me the users name but rather the url

    — commented 3 years ago by Napp Dev

  • ok, you didn't ask clearly enough.

    Doesn't /name return JSON, so grab the URL with an httpClient call and parse the json to get the data you need.

    — commented 3 years ago by Stephen Feather

    • The FaceBook Graph API is REALLY well documented when compared to other APIs. Before asking how to integrate a 3rd party API with Titanium, please at least try to understand the 3rd party API first. (even if Titanium has built in support, you are still responsible for understanding both ends)

    • returns a binary stream.

    • returns a JSON array. You will need to use Ti.Network.HTTPCLient to grab the JSON array returned from Graph

    Ex: returns:

    "id": "295053353871174",
       "name": "Conversion Center",
       "link": "",
       "namespace": "conversion_center",
       "icon_url": "",
       "logo_url": ""

    — commented 3 years ago by Stephen Feather

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!