iamarnold
iamarnold

Reputation: 229

Use of undeclared Identifier 'Fabric'

I'm integrating Twitter Fabric into my app. I get an error when I try to use Fabric to save my keys in my Info.plist. Any ideas? On the documentation it says:

To initialize the Twitter Kit with your app’s credentials, pass them to startWithConsumerKey:consumerSecret: before passing the shared instance to Fabric.

Calling startWithConsumerKey:consumerSecret: will override any keys which were automatically configured. Automatically configured keys live in your app’s Info.plist under the key Fabric.

[[Twitter sharedInstance] startWithConsumerKey:@"your_key"
                                    consumerSecret:@"your_secret"];
[Fabric with:@[[Twitter sharedInstance]]]; //<--Gettings Use of undeclared Identifier 'Fabric' error

Upvotes: 3

Views: 2100

Answers (1)

HeroOfSpielburg
HeroOfSpielburg

Reputation: 209

The Fabric header, which is the parent framework for all child libraries including TwitterKit, must be included here.

Add:

#import <Fabric/Fabric.h>

to your .m file. Make sure you've added the Fabric framework to your Xcode project as well (which is separate from the TwitterKit framework).

Upvotes: 3

Related Questions