Twitter setup through fabric is not setting up project

ios
twitterkit

#1

I am getting an error everytime I am clicking on the TWTRLogInButton - I have setup using the Fabric App, all of the keys required are in the plist but I am consistently getting this error:

Terminating app due to uncaught exception 'TWTRInvalidInitializationException', reason: 'Attempted to call TwitterKit methods before calling the requisite start methods; you must call +[Fabric with:@[Twitter class]] before using the methods on TwitterKit. If you are not storing your consumerKey and consumerSecret in your application's info.plist you must also call -[TwitterKit startWithConsumerKey:consumerSecret:] before calling +[Fabric with:]'

Everything is in the AppDelegate that is required - I have even tried to initiate the key and secret via the method provide and still nothing.

Please advise


#2

Can you share an example of the method you call in your application:didFinishLaunchingWithOptions: method?

For example, [[Twitter sharedInstance] startWithConsumerKey:@"q1r0xThkM0" consumerSecret:@"ovEqziMkm63Qg2mj"];.


#3
Twitter.sharedInstance().start(withConsumerKey: "", consumerSecret: "")
Fabric.with([Crashlytics.self, Twitter.self])

Just the standard that is in the documentation, obviously the keys are in there


#4

You can try adding a breakpoint in application:didFinishLaunchingWithOptions: to make sure that your configuration method is being called and then a symbolic breakpoint in -[Twitter logInWithMethods:completion:]

Add Symbolic Breakpoint

Fill in Method Signature

That should allow you to confirm the order that the configuration and login calls are happening.


#5

The login call is upon a user interaction - so ordering would not be an issue.

I have added a break point after the delegate set tokens:
po Twitter.sharedInstance().sessionStore.authConfig.consumerKey
po Twitter.sharedInstance().sessionStore.authConfig.consumerSecret

and they are printing out the set information and also when my custom button press and the Twitter.sharedInstance().logIn { (session, error) in is called and same again


#6

It’s working, I have removed the plist entries that Fabric put into the app upon setup and it’s all working as expected now.

I guess you guys need to have a look at this.


#7

Thanks for the heads up.


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.