简体   繁体   中英

Facebook - Getting current user id with app access token

My Facebook tab app, uses the FB.ui send dialog to send invitations to the user's friends to join and collaborate in my app.

在此处输入图片说明

Since the send dialog response is just a {success:true} JS Object, I can't tell who the recipients are.

By calling: https://graph.facebook.com/oauth/access_token?client_id=MY_APP_ID&client_secret=MY_APP_SECRET&grant_type=client_credentials

I can get a valid access token, and can query public information of a specific user like so:

https://graph.facebook.com/USER_ID?access_token=MY_APP_ACCESS_TOKEN


Q :How can I get the current user id, without forcing a login ... is it possible?

If you use a Page Tab App, you could access the signed_request as described here: https://developers.facebook.com/docs/reference/login/signed-request/

Upon using the Share Dialog it's not possible AFAIK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM