After the recent iOS 9 update, along with updates to the Facebook SDK (4.6.0), I'm finding that my login session is no longer persisting between app launches.
My flow so far has been pretty simple.
FBSDKLoginButton
.FBSDKAccessToken.currentAccessToken()
to be able to then use Facebook in the app.What I'm finding is after the recent updates my AccessToken is now showing up as nil
if I close and start the app again. This is a major issue because previously, I only had to login once, and then my session was being automatically renewed.
If I'm correct, login should only occur once, and after that the app should be able to either store the info it needs to connect to Facebook in the future, or simply remain with a token that refreshes itself.
Does anyone have any ideas what might have changed to cause this after the iOS9 or 4.6.0 Facebook SDK updates? Is there properties that need to be persisted to then refresh the token in the future or is the token supposed to renew automatically? I'm near 100% positive, the intended experience with Facebook SDK is NOT to have to login on every app launch (When you restart the app, close all the way and open again).
Thanks!
Update
As requested in a response, I added an additional key into the TransportSecurity info of my Plist file. Unfortunately, no luck still.
Adding this line on didFinishLaunchingWithOptions
worked for me:
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
Final method looks something like this:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
if let accessToken = FBSDKAccessToken.currentAccessToken(){
print(accessToken)
}else{
print("Not logged In.")
}
return true
}
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With