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

Access Token Expiration error #2379

Open RaphaelNSG opened 1 month ago

RaphaelNSG commented 1 month ago

Checklist before submitting a bug report

Xcode version

15.3

Facebook iOS SDK version

17.0.0

Dependency Manager

Other / I don't know

SDK Framework

Login

Goals

I want to know the real access token expiration date.

Expected results

When i has an access token i can't check the expiration date.

Actual results

When i login on IOS using classic login the expiration date of the access token is wrong: 4001-01-01 00:00:00 +0000

Steps to reproduce

I used the login example that comes with the plugin. The only change that i mad was add a new label to show the expiration: expirationLabel.text = accessToken?.expirationDate.description ?? Self.missingAccessToken

Code samples & details

In the `LoginDetails.storyboard` i added a new label and in the `LoginDetailsViewController` i filled the label with the access token expiration: `expirationLabel.text = accessToken?.expirationDate.description ?? Self.missingAccessToken`
RaphaelNSG commented 1 month ago

I got a way to fix token expiration by just calling refresh token after successful login. This is my login flow: