So I've been doing some experimentation with Facebook integration for my app and noticed that the UserId that I was pulling from the Facebook plugin no longer matched my Facebook user id.
After some research, here are my findings:
- Since the Graph 2.0 API was introduced by Facebook, you are no longer going to get new user's Facebook User ID, instead Facebook will give you the "app-scoped user id". Near as I can tell, it's still unique, but definitely something to be aware of. I don't know if you can get the original user id based on an app-scoped user id.
- The Scirra Facebook plugin is fetching the app-scoped id and using the javascript parseFloat to convert the value. Unfortunately, this seems to very occasionally introduce decimal values to the id, for example, when testing with my Facebook account, the app-scoped id changed from 38742387293 to 38742387293.0005. I made a modification to the actual Facebook plugin to return the app id as a string but anyone who doesn't feel comfortable modifying JS code can *probably* just use a floor command on the number.