thibaut noah
thibaut noah

Reputation: 1514

Cannot init both Twitter and Crashlytics with Fabric

After migrating to swift 3, the initialisation i used for both crashlytics and twitter (since only one call to fabric is permitted) is not working anymore.

The method given the documentation doesn't work either (it didn't work in swift 2 either by the way). What is the proper way to initialize this?

I tried all the methods listed here : How to init Fabric properly in Swift and the init i used before was this :

`        Fabric.with([Crashlytics.self, Twitter.self])`

But none are working for swift 3.

Error message : Calling Twitter.start is not supported

Upvotes: 0

Views: 527

Answers (2)

Peter Lapisu
Peter Lapisu

Reputation: 21005

TwitterKit 3+ is no longer part of Fabric

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

See https://dev.twitter.com/twitterkit/ios/installation

you have to add the TwitterKit to the pods as well

pod 'Fabric'
pod 'Crashlytics'
pod 'TwitterKit'

Upvotes: 1

thibaut noah
thibaut noah

Reputation: 1514

FIY since twitter kit 3, it is separated from fabric so we now need to instantiate both separatly.

Upvotes: 3

Related Questions