skip to Main Content

I’m working on an app which needs to integrate with Twitter in more detail than the built-in Twitter.framework allows for.

Twitter publishes their APIs using Fabric.app which has a very hard time with upgrading frameworks.

I would like to just include the Frameworks that Fabric.app is going to include in my project and skip all the setup hassle that they create with their “easy integration solution”. What do?

2

Answers


  1. I dont think that it is possible at the moment, Since twitter bought crashlytics and crashlytics requires fabric we had the similar concerns and looks like TwitterKit also uses Fabric to start sessions.

    According to here https://docs.fabric.io/ios/twitter/twitterkit-setup.html#integrate-with-your-app

    This call has to be made;

    [[Twitter sharedInstance] startWithConsumerKey:@"your_key" consumerSecret:@"your_secret"];
    [Fabric with:@[[Twitter class]]];
    

    and you dont know what is going on in Fabric.m but header file requires Twitter to initialized

    /**
     *  Fabric Base. Coordinates configuration and starts all provided kits.
     */
    @interface Fabric : NSObject
    
    /**
     * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use.
     *
     * For example, in Objective-C:
     *
     *      `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];`
     *
     * Swift:
     *
     *      `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])`
     *
     * Only the first call to this method is honored. Subsequent calls are no-ops.
     *
     * @param kitClasses An array of kit Class objects
     *
     * @return Returns the shared Fabric instance. In most cases this can be ignored.
     */
    + (instancetype)with:(NSArray *)kitClasses; 
    
    Login or Signup to reply.
  2. Mike from Crashlytics and Fabric here.

    If you want to install any part of Fabric, without Fabric.app, you can do so, via Cocoapods by heading to the web onboarding here: https://fabric.io/kits/ios/twitterkit/install

    Effectively, add the following to your podfile:

    pod 'Fabric'
    pod 'TwitterKit'
    

    Then run pod install

    Add the run script build phase with the API key and build secret that will be given when logged in at the above page.

    "${PODS_ROOT}/Fabric/run" <API_KEY> <Build_secret> 
    

    Then add your API key and Twitter Consumer Key and Secret into your info.plist:

    <key>Fabric</key>
      <dict>
        <key>APIKey</key>
        <string>API_KEY</string>
        <key>Kits</key>
        <array>
          <dict>
            <key>KitInfo</key>
            <dict>
              <key>consumerKey</key>
              <string>Consumer Key</string>
              <key>consumerSecret</key>
              <string>Consumer Secret</string>
            </dict>
            <key>KitName</key>
            <string>Twitter</string>
          </dict>
        </array>
      </dict>
    

    Then initialize the kit, recommended in your app’s delegate:

    #import <Fabric/Fabric.h>
    #import <TwitterKit/TwitterKit.h>
    
    [Fabric with:@[[Twitter class]]];
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search