2

Can I get the user_id without him acepting my app?

I need to build a poll app that should not require auth do vote. If I can store the user_id I can make sure all votes are unique...

Thanks

Hugo Tavares
  • 37
  • 1
  • 6

3 Answers3

4

It is very limited what you can get when the user didn't install your app. Because getting the uid is the same as getting all public data for the user (you can query all public data with that uid and any access_token of some other user). So, unfortunately, you have to ask for an app install when you want to use Facebook to track if the user has already voted.

Jan Olaf Krems
  • 2,274
  • 1
  • 14
  • 11
1

There is no way to get that information without the user sharing it with your app by way of accepting/authorizing your app.

If you could get the user ID without the user authorizing your app, then it would violate the Platform policies https://developers.facebook.com/policy/.

DMCS
  • 31,720
  • 14
  • 71
  • 104
-1

Just call the following api to get user id in response.

 FB.api('/me', 'post', function(response)
{
console.log(response);
});
Mehul Hingu
  • 1,240
  • 1
  • 9
  • 12