Facebook SDK v4.0 for iOS - FBSDKProfile currentProfile not being set

前端 未结 8 2664
星月不相逢
星月不相逢 2020-12-25 13:35

I\'ve just \"upgraded\" my Facebook SDK to 4.0 for my iOS app.

I\'ve got the log in working okay, however, according to the documentation, I\'m now supposed to use

8条回答
  •  渐次进展
    2020-12-25 14:02

    In objective-C I used the following approach based on comments in this thread.

    If this flag is set to yes, after login or logout a notification will be called. So in viewDidLoad add this line of code and add the notification to be called after user profile get received.

    [FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
    
    [[NSNotificationCenter defaultCenter] addObserverForName:FBSDKProfileDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
         //do whatever you want
    }];
    

    All information in this link https://developers.facebook.com/docs/facebook-login/ios/v2.3#profiles

提交回复
热议问题