Issue installing and getting started with Twitter Framework


#1

I followed the guidelines on the installation page and I have tried following Fabric application on my mac. The issue i’m having is after importing Fabric, TwitterKit I get an error when building the project.

Any help would be much appreciated!


#2

Thanks for reaching out on this @kandanar. I’m not hitting the same issue locally:

    import UIKit
    import Fabric
    import TwitterKit


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
   /*     let TWITTER_CONSUMER_KEY = "adsfadsfasdfad"
          let TWITTER_CONSUMER_SECRET = ";fasdfasf"
        
            Twitter.sharedInstance().startWithConsumerKey(TWITTER_CONSUMER_KEY, consumerSecret: TWITTER_CONSUMER_SECRET)*/
         Fabric.with([Twitter.self])
        return true
    }

I’m running Twitter Kit - 2.3.0. What version are you running or does a clean of your project help?


#3

Hey thanks so much for the quick reply!

I have tried cleaning it but no luck. I integrated the TwitterKit not using cocoapods but with the Fabric application, so it should be the latest? Anyway I can confirm which version I am running?


#4

That should be the latest - would you be willing to share more of your AppDelegate.Swift? Mine’s pretty basic, but here it is in full:

//
//  AppDelegate.swift
//  FabricSampleTwitterLoginSwift
//
//  Created by Mike Bonnell on 7/31/15.
//  Copyright (c) 2015 MikeBonnell. All rights reserved.
//

import UIKit
import Fabric
import TwitterKit


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
   /*     let TWITTER_CONSUMER_KEY = "adsfadsfasdfad"
          let TWITTER_CONSUMER_SECRET = ";fasdfasf"
        
            Twitter.sharedInstance().startWithConsumerKey(TWITTER_CONSUMER_KEY, consumerSecret: TWITTER_CONSUMER_SECRET)*/
            Fabric.with([Twitter.self])
        return true
    }

    func applicationWillResignActive(application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    func applicationDidEnterBackground(application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    func applicationWillEnterForeground(application: UIApplication) {
        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    }

    func applicationDidBecomeActive(application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    func applicationWillTerminate(application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }


}

With my Fabric API key, Twitter Consumer Key and Secret in my info.plist. Project setup:


#5

import UIKit
import Firebase
import Fabric
import TwitterKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    
    Fabric.with([Twitter.self()])
    FIRApp.configure()
    return true
    
}


func applicationWillResignActive(application: UIApplication) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

}

Thanks again for the quick replies!


#6

Hmm, that builds for me just fine if I comment out Firebase.

Are you using CocoaPods? If so, try going through the steps here once more and let me know if that helps: https://fabric.io/kits/ios/twitterkit/install


#7

I am actually not using the cocoa pods for these frameworks. I tried Cocoapods and got the same result therefore I tried following the xcode method on Fabric and once again got the same results


#8

Here’s a project to compare with: https://twitter.box.com/s/yrryqyl1hnixfew8gi9krsctul1xd1ws You’ll need to your API key to the run script build phase and info.plist - API key, Twitter Consumer Key and Secret.


#9

I think the issue i am having is that im using incorrect keys/ secret …is there anyway you could confirm this for me? Would it be a good idea to post it on here?


#10

Hey @kandanar,

Please do not post your keys here. Log in to this page and you can check the values: https://fabric.io/kits/ios/twitterkit/install The keys will be filled in for you to compare against.


#11

Hey Bonnel,

I realized the issue is to do with my GoogleServices-Info.plist file…everything seems to work without it. However once I add that in I get that error. However I need this file to use Firebase…any advice?


#12

Thanks for letting me know @kandanar, unfortunately I’m not an expert on Firebase or the GoogleServices-Info.plist file. I’d recommend posting or asking via one of the options that team recommends here: https://firebase.google.com/support/