Access FB Graph API (FB.ui) after

420 views
Skip to first unread message

Cuong Vu

unread,
Jul 25, 2013, 3:25:23 PM7/25/13
to fireba...@googlegroups.com
Hi all, this question might be asked but I couldn't find the answer. Basically after authenticating with Facebook using FirebaseSimpleLogin, how can I access all Facebook Graph API (specifically FB.ui) to, for examples, post to feed or send message to friends?

Thank you, 

Erik Beeson

unread,
Jul 25, 2013, 4:10:00 PM7/25/13
to fireba...@googlegroups.com
After authenticating, the "user" object (that is: the second argument passed to your FirebaseSimpleLogin callback) includes a property called "accessToken".

For example, to get the current user's friends (with jQuery):

var authClient = new FirebaseSimpleLogin(firebase, function(error, user) {
if(user) {
$.ajax({
type: 'get',
data: {
access_token: user.accessToken
},
dataType: 'json'
}).done(function(response) {
// do something with response.data
});
}
});

Hope that helps.

--Erik




On Thu, Jul 25, 2013 at 12:25 PM, Cuong Vu <cuong...@gmail.com> wrote:
Hi all, this question might be asked but I couldn't find the answer. Basically after authenticating with Facebook using FirebaseSimpleLogin, how can I access all Facebook Graph API (specifically FB.ui) to, for examples, post to feed or send message to friends?

Thank you, 

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Cuong Vu

unread,
Jul 26, 2013, 1:52:02 AM7/26/13
to fireba...@googlegroups.com
Thanks Erik for your response. I'm kind of a noob here. I was able to access current user's friends. However, what I want to do is to post to wall/timeline of friends or send message to them. I found this: http://fbdevwiki.com/wiki/FB.ui#method:_.27feed.27 and thought I could try to use FB.ui, but I could not initialize the FB SDK once I already get authorized with Firebase because the site URLs for those two to work are different. Kind of clumsy explanation, hope that make sense.

Good thing I figure out that I can set the scope for auth.login to request extended permission, and there's permission to publish. However, I don't know how to write the http POST with access token in javascript (I'm using Angularjs). So I guess that's my another question. 

Thanks,
Reply all
Reply to author
Forward
0 new messages