facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.73k stars 3.5k forks source link

AuthenticationToken.current == nil #2403

Open chengssir opened 2 weeks ago

chengssir commented 2 weeks ago

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
zhong-meta commented 2 weeks ago

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.