facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.

Home Page:https://developers.facebook.com/docs/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AuthenticationToken.current == nil

chengssir opened this issue · comments

Checklist before submitting a bug report

Xcode version

15.1

Facebook iOS SDK version

17.0.0

Dependency Manager

CocoaPods

SDK Framework

Core

Goals

get token

Expected results

token

Actual results

AuthenticationToken.current == nil

Steps to reproduce

    let faceBook = LoginManager()
    faceBook.logOut()
    guard let configuration = LoginConfiguration(
        permissions:["public_profile"],
        tracking: .enabled
    )
    else {
        return
    }
    faceBook.logIn(configuration: configuration) { result in
        switch result {
           case .cancelled, .failed:
            break
           case .success(_, _, let token):
            print("######################## \(AuthenticationToken.current)")
        }
    }

Code samples & details

// INSERT YOUR CODE HERE
var example = "Example code" 111

Hello,

In response to the upcoming changes to ATT enforcement, we made changes to the iOS SDK and the SDK no longer provides valid user access tokens in scenarios where the user opts out of ATT. The access token validation or Graph API requests may throw errors like OAuthException - “Invalid OAuth access token - Cannot parse access token”. Our recommendation is that users integrate Limited Login following the official documentation:
https://developers.facebook.com/docs/facebook-login/limited-login/ios
https://developers.facebook.com/docs/facebook-login/limited-login/unity/

See more details here.