facebook / facebook-ios-sdk

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

`AccessToken.current` is always null, even after successful login #2238

Open mikedJC opened 1 year ago

mikedJC commented 1 year ago

Checklist before submitting a bug report

Xcode version

14.3.1 (14E300c)

Facebook iOS SDK version

16.1.3

Dependency Manager

Building from Source

SDK Framework

Login

Goals

We noticed in our live games that FB sessions were just disappearing. The normal login flow would occur but then after closing the game and re-launching the access token would be null. This issue didn't affect all users but we had tens of thousands of logs showing it occurring.

Using the SDK in the most basic sense, we would simply login. After successful login we grab the profile data. After the app is closed and we re-launch the token would be wiped and our users would be logged out of FB.

Expected results

The expected result would be for the AccessToken to persist across launches.

Actual results

The actual results are the AccessToken is null. Note that using the repro steps below this can be seen that without even requiring a shutdown + relaunch the AccessToken can still be null.

Steps to reproduce

Using the FacebookLoginSample the issue can be reproduced.

Screenshot 2023-08-02 at 9 25 47 AM

Code samples & details

The unmodified FacebookLoginSample will reproduce the issue (after adding proper FB App ID + bundle ID + URL Scheme)
alex-ha-MA commented 4 months ago

Hi @mikedJC , Have you managed to find a solution or the reason for the issue?

mikedJC commented 4 months ago

@alex-ha-MA I did hack together a fix but I can't seem to find the commit from back when I fixed it...