Using titanium, does anybody have some simple instructions to get the user’s facebook name, once signed into facebook?
Using titanium, does anybody have some simple instructions to get the user’s facebook name,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ah, here is how you do it:
Finally, along with
nameandusername, check out the facebook page for the other variables you can get –http://developers.facebook.com/docs/reference/api/
FINALLY: be aware that this is a callback, and titanium won’t actually wait for this call to finish. That is, any variable declared to hold the results the returned after the requestWithGraphPAth will immediately return, and as a result almost always be empty.
I guess you could make a nifty loop that just… loops until some variable is set to false. And you’d set the variable to false in the callback… but that seems dodgy.
Just make your call back do everything else, that is, save to the db etc etc
If you do go the route of calling Ti.Facebook.authorise() to log in the user, remember to define
before the call. And then, in the success bit, you can make a requestWithGraphPath call and so on. I just save all the details to the database and retrieve them each time after that, works fine for me!