I have an problem in my app. The only thing I need from a user is there facebook id. After they log onto facebook they are redirected back to my app and I can get the userID with $facebook->getUser(). This works fine except when the user has chosen a username on facebook. Then I get a really weird long ID that is different from the userid.
To clarify, let's say I ask the userid from a user that hasn't set a username, I get for example the id: 1234567891. When a user has set a username, I get an ID like: 100002339295322.
Anyone maby knows how I can solve this ?
If you need code samples of how I do things, I do them as told on the facebook developers site: http://developers.facebook.com .
With friendly greetings, Bob
PS: I use the CodeIgniter framework and the official facebook php sdk
*/// EDIT \*
The problem is solved. Apparently it had something to do with the datatype I used for the field. I changed it from int to varchar and now everything is working.
I had a similar problem, and found out that after v2.0 API user_id is app scoped. I had two user_id for the same user's profile but different application, and both are valid for their respective app.
You can reach the user profile with
http://facebook.com/app_scoped_user_id/<USER_ID>
You may also query the graph api, using the app token and the app scoped user id.
Ref.: https://developers.facebook.com/docs/apps/upgrading/#upgrading_v2_0_user_ids
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With