草庐IT

currentProfile

全部标签

ios - 适用于 iOS 的 Facebook SDK v4.0 - FBSDKProfile currentProfile 未设置

我刚刚为我的iOS应用程序将我的FacebookSDK“升级”到4.0。我的登录工作正常,但是,根据文档,我现在应该使用FBSDKProfile.currentProfile()来访问配置文件信息。但是,这个值似乎总是nil,即使正在显示我的个人资料图片(通过FBSDKProfilePictureView)和我的FBSDKAccessToken.currentAccessToken()不是nil。这是我的登录ViewController:importUIKitclassLoginViewController:UIViewController,FBSDKLoginButtonDelega

ios - 适用于 iOS 的 Facebook SDK v4.0 - FBSDKProfile currentProfile 未设置

我刚刚为我的iOS应用程序将我的FacebookSDK“升级”到4.0。我的登录工作正常,但是,根据文档,我现在应该使用FBSDKProfile.currentProfile()来访问配置文件信息。但是,这个值似乎总是nil,即使正在显示我的个人资料图片(通过FBSDKProfilePictureView)和我的FBSDKAccessToken.currentAccessToken()不是nil。这是我的登录ViewController:importUIKitclassLoginViewController:UIViewController,FBSDKLoginButtonDelega

ios - FBSDKProfile currentProfile 为 nil 但 FBSDKAccessToken currentAccessToken 有值

正如标题所说,这是一个错误还是真的有可能?我使用[FBSDKAccessTokencurrentAccessToken].tokenString检查现有的Facebooksession是否存在,然后我将使用[FBSDKProfilecurrentProfile].userID获取session的用户身份。但是有时我会遇到[FBSDKAccessTokencurrentAccessToken].tokenString有一个值但是[FBSDKProfilecurrentProfile]是nil。我将它用于我的应用程序的自动登录功能。感谢您的回复!所以我有这个代码片段:if([FBSDKAc