TwitterKit crashes on iOS after uninstalling Twitter app

ios

#1

TwitterKit 3.1.1 (note I’m not using 3.2.1 because it has rendering bugs)

Steps to reproduce:

  1. On an iOS device with the Twitter app installed, launch an app with TwitterKit integrated and verify that you can tweet
  2. Without killing the other app, delete the Twitter app from the phone
  3. Open the other app and try to tweet. Assuming it has not been killed, TwitterKit crashes on Twitter.sharedInstance().sessionStore.hasLoggedInUsers(). The failure is in this assertion: -[Twitter assertTwitterKitInitialized]. It reports this as the cause:
# Cause: Attempted to call TwitterKit methods before calling the requisite start method. You must call Twitter.sharedInstance().start(withConsumerKey:consumerSecret:) before calling any other methods.

TwitterKit has already been started on app startup, but presumably the session store is in an inconsistent state because the Twitter app was deleted without TwitterKit being initialized again.