App crashes using Facebook Login SDK when I go to the home screen

喜你入骨 提交于 2019-12-04 04:16:35

I have came across this issues recently, and i solved it by adding this piece of code in Appdelegate.m.

- (void)applicationDidBecomeActive:(UIApplication *)application {    

    [FBSDKAppEvents activateApp];
}

For Swift 3 version:

func applicationDidBecomeActive(_ application: UIApplication) {

    FBSDKAppEvents.activateApp()
}

Update to 4.12, it fixes the issue according to their release notes:

https://developers.facebook.com/docs/ios/change-log-4.x/

The part that says:

Fixed

  • Fixed cases where AppEvents could crash because of missing session id.
  • Fixed bug in some cases where access token expiration date was the refresh date.

Although this is not necessarily a comprehensive solution, I have exhausted my debugging methods. I have removed the FBSDK's from my podfile, run pod update to remove them from the project, and reinstalled the version 4.10 FBSDK's in my frameworks folder. I will update this question after trying again when facebook releases an updated version of the FBSDK's.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!