0

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.

enter image description here

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?

Shlomi Schwartz
  • 8,693
  • 29
  • 109
  • 186
  • You can not get user id without the user log in. – WizKid Jul 14 '14 at 16:06
  • Please refer to this subject [How to get the Facebook user id using the access token](http://stackoverflow.com/questions/3546677/how-to-get-the-facebook-user-id-using-the-access-token) – Stoyan Bonchev Aug 01 '16 at 10:49

1 Answers1

0

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.

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • Thanks for the reply, however if a user did not approve your app the user info is just '"user":{"country":"uk","locale":"en_US","age":{"min":21}},' without the id – Shlomi Schwartz Jul 14 '14 at 14:24
  • Signed request will only return a user ID if that user has logged into your app and granted it some permissions – Igy Jul 14 '14 at 16:23