While fetching sessionStore from Twitter SDK, it's getting crash! TWTRTwitter.sharedInstance().sessionStore See the attached image for the issue.enter image description here

I'm getting this issue in swift 4.2, before it was working fine.

1 Answers

0
rpecka On

The error says that you need to call a method that starts up the twitter session before you can call any other methods from the twitter sdk. According to twitter's documentation, you should add the following to your AppDelegate:

Paste your own key and secret below

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    TWTRTwitter.sharedInstance().start(withConsumerKey:"hTpkPVU4pThkM0",
consumerSecret:"ovEqziMzLpUOF163Qg2mj")
    return true }

func application(_ app: UIApplication, open url: URL, options:
[UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    return TWTRTwitter.sharedInstance().application(app, open: url, options: options) } ```