ios Facebook SDK v4.x access token null despite being logged in via FBSDKLoginButton

前端 未结 6 590
花落未央
花落未央 2021-01-04 12:34

My facebook access token is null despite the fact that the button shows that I\'m logged in. Anyone know why this would be?

From RootViewController.m



        
6条回答
  •  孤独总比滥情好
    2021-01-04 13:20

    It happened to me too, the "Login with Facebook" button was working as expected, I was being asked for permissions, allowed them, the application:openURL:... delegate method was being called with an URL that seemed valid, nonetheless the accessToken property remained nil.

    The problem in my case was the fact that somehow Shared Keychain was removed from the application entitlements, thus the Facebook SDK was not able to save the token in keychain. Enabling the capability solved the problem.

    The odd thing is that this was a silent error, so it was not clear from the beginning why the access token wasn't being set...

提交回复
热议问题