When a user opens my app, the login flow goes like this:
- Start TwitterKit with
Twitter.sharedInstance().start(withConsumerKey: consumerKey, consumerSecret: consumerSecret).
- Start Fabric with
Fabric.with([Crashlytics.self, Twitter.self]).
- Check for an existing session with
Twitter.sharedInstance().sessionStore.session().
- If there is no existing session, allow them to login with
Twitter.sharedInstance().logIn(withMethods: TWTRLoginMethod.webBasedForceLogin).
I’m seeing an intermittent problem where quite frequently, a user will open the app, after having previously logged in, and there won’t be an existing session - it’ll return nil, so they’re asked to login again. But then if they quit the app or cancel the new login, then start the app again, the existing session is returned as expected.