Search code examples
iosamazon-web-servicesfacebook-ios-sdkamazon-cognito

Get reference of facebook access token - Facebook SDK 4.X


I have been using Facebook's login functionality to link to AWS Cognito system. To link them you require the String of Facebook's access token. Prior to version 4.0 I used

NSString *facebookToken = FBSession.activeSession.accessTokenData.accessToken;

Since the update this no longer works. I tried

NSString *facebookToken = FBSDKAccessTokenChangeNewKey;

But this also didn't work. Any suggestions? I can't find it in the reference guide or sample projects.


Solution

  • FBSession.activeSession.accessTokenData.accessToken;
    

    has changed to

    [FBSDKAccessToken currentAccessToken].tokenString