8

I'm trying to implement Fabric into my app. The problem is, that the app isn't working correctly and I have no idea what code to place in my AppDelegate. I can't find any information on the web what should I implement there. Can anyone give me a tip, what functions should I implement in my AppDelegate?

Fabric screenshot

Nat
  • 12,032
  • 9
  • 56
  • 103

3 Answers3

5

Assuming you used the build script to setup Fabric, it will have placed the appropriate consumerKey and consumerSecret in your project's info.plist.

You can initialize Fabric with this method:

Swift

Fabric.with(Twitter(), Crashlytics()) // Add whichever Kits you are using

ObjectiveC

[Fabric with:@[[Twitter sharedInstance]]] // Add whichever Kits you are using

Double check that your plist contains an entry for Fabric and add this line of code to your application:didFinishingLaunchWithOptions: method.

https://dev.twitter.com/twitter-kit/ios/configure

Nat
  • 12,032
  • 9
  • 56
  • 103
DBoyer
  • 3,062
  • 4
  • 22
  • 32
2

Do you want to use Crashlytics with Objective-C?

In your AppDelegate.m:

At the top of the source file,

#import "Fabric/Fabric.h"
#import "Crashlytics/Crashlytics.h"

and in application:didFinishLaunchingWithOptions:,

[Fabric with:@[CrashlyticsKit]];
Hiron
  • 1,457
  • 1
  • 13
  • 12
1

For swift the missing code is:

import Fabric
import Crashlytics

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
        Fabric.with([Crashlytics()])
        //... your initialization code
        return true
    }
HotJard
  • 4,598
  • 2
  • 36
  • 36