Facebook API: How to get the FB login user's unique ID? ID from API doesn't match 'real' user ID in v2.0

前端 未结 1 1893
无人及你
无人及你 2020-12-10 06:26
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id)user 
{
    self.profilePictureView.profileID = user.objectID;
    self.nameLab         


        
相关标签:
1条回答
  • 2020-12-10 07:31

    Since v2.0 of the Facebook API the user IDs returned to your app are scoped to your app (i.e each app receives a different identifier for any given user) - you can't compare what that site is telling you to what your app received when you called user.objectID because they're intentionally different strings

    Use the ID returned to your app as the identifier for users in your app - there's no need to try and find the 'real' or 'old' user ID - there's no reason for you to need to use the user ID given to any other app ID

    There's more information about that the changes from v1.0 to v2.0 here: https://developers.facebook.com/docs/apps/upgrading

    And the app-scoped IDs are specifically discussed here, including a way for developers with multiple apps to corelate the IDs for users who use more than one of their apps : https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids

    0 讨论(0)
提交回复
热议问题