Fabric(twitter api) setup issue. Using swift - swift

Hi I am using the Twitter API for the first time and have little experience with APIs in general. I installed the fabric app and am following the documentation to integrate twitter using swift.
When I build my app and install the twitter option on fabric, it asks me to run my code.
When I do that I get a 'Signal SIGABRT' error on the line Fabric.with([Twitter()]) in the AppDelegate.swift file.
Before this I had added the import TwitterKit line to the AppDelegate.
I also tried to add these lines following the API documentation:
Twitter.sharedInstance().startWithConsumerKey("your_key", consumerSecret: "your_secret")
Fabric.with([Twitter.sharedInstance()])
and then the error comes in the Twitter.sharedInstance() line.
I am adding these lines in the func Application method.
From the language I use, it is very evident that I am a newbie to programming and really need good help smiley
Thanks in advance.

To fix the problem, I did the following:
Open XCode Target
Go to the "Build phases" tab
Click the "Copy bundle resources" section
Click the add button
Add TwitterKitResurce.bundle

Related

Google Calendar API - No such module 'GoogleAPIClientForREST'

I'm trying to integrate the Google Calendar API on iOS. I've followed the iOS Quickstart. I've managed to get the objective-c version to run but I need to get it to work in Swift. I'm getting an error loading the module 'GoogleAPIClientForREST'
I'm using cocoapods as shown in the example. All looks to be loaded fine on the pod side, as you can see in the screenshot.
Has someone succeeded to run the google example in swift ?
THANKS!
Linking the library with the binary resolved the module not found error.
I then ran into another error "Value of type 'GTLRCalendarService' has no member 'authorizer'" in the signin method (Two instances of the error). Found a solution to this error here
Solved this by creating a bridging header where I included these lines
#import <GTMSessionFetcher/GTMSessionFetcher.h>
#import <GTMSessionFetcher/GTMSessionFetcherService.h>
Here's my Xcode project incase it can help someone.
Thanks

After implementing Google Analytics according to documentation, I am getting an Use Of Unresolved Identifier 'GGLContext' Error

I have implemented the Google Mobile Analytics according to steps outlined on the Google Documentation Page. I have added the pod, I have the bridging header in place, I have downloaded the configuration file and imported the plist file provided. However, when I insert the following code into my appDelegate file, I get the error Use of Unresolved Identifier 'GGLContext'.
// Configure tracker from GoogleService-Info.plist.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
// Optional: configure GAI options.
var gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true // report uncaught exceptions
gai.logger.logLevel = GAILogLevel.Verbose // remove before app release
I have searched many forums and cannot find any solution. I have even run pod try Google and looked at their example project and cannot see a difference. Has any experienced this before (XCode 6.4, OSX 10.10.5, Swift 1)?
Don't use CGLContext try to implement it manually with your Google Analytic ID.
I find this more reliable, as I also try to do it the Google documented way that didn't work for me as well, I believe they have to update their context (I believe this is due to swift 2 - Update).
Example: enter this in your AppDelegate.swift within didFinishLaunchingWithOptions: method.
// Init GAI.
let Tracker = GAI.sharedInstance()
//Add Publisher Track ID
Tracker.trackerWithTrackingId("UA-XXXXXXXXX-X")
Please ask if you have any other question you would like to manually implement (trackUncaughtExceptions, logger etc)
UPDATE:
Your bridge header file should look something as following, you should add whichever feat you're using in Google Analytic Framework.
//Google Analytics
#import "GAI.h"
#import "GAITracker.h"
#import "GAIFields.h"
#import "GAIDictionaryBuilder.h"
Here is a screenshot of available classes.
just do this
pod 'Google/Analytics'
and
pod install
create -Bridging-Header.h in your project root.
and then copy that to .h file
#import <Google/Analytics.h>
and drag and drop GoogleService-Info.pist to root of project.
this is so important. go to build setting and find swift compiler-code Generation and then set $(SWIFT_MODULE_NAME)-Bridging-Header.h to Objective-C Bridging Header
clean project and build and then run.
At the point in time the 'Google/Analytics' pod doesn't support Bitcode, so when you go to do a production build, you will run into problems. Especially if you want to support WatchOS or tvOS.
At this point in time, using the "GoogleAnalytics" pod seems to be the best option, and setting up the tracker manually with
// Init GAI.
let Tracker = GAI.sharedInstance()
//Add Publisher Track ID
Tracker.trackerWithTrackingId("UA-XXXXXXXXX-X")
You can also go to https://code.google.com/p/analytics-issues/issues/detail?id=671 and scroll to the bottom to vote for Google to fix the recommended path to work with Bitcode.
To import 'Google/Analytics' framework to your swift code, simply import the module using . as package separator:
import Google.Analytics
It will import all required classes without having to modify the bridging header.
You can manually import the GGLCore.framework in ViewController.swift like
import GGLCore
Like this you can manually import the GGL file

iphone twitter code explanation

what is this step doing?
following a tutorial to integrate twitter into an iphone app , this steps is done in the target>
If we right click on this and select Get Info we will see the info about our target. From here we click the build tab and search for the field “Header Search Paths”. You need to add the following into the Header Search Paths:
$(SDKROOT)/usr/include/libxml2
the build works fine, but I want to know what is that accomplishing, linking a library? why not from the normal way of adding libraries?
thanks a lot!
Linking the library is a separate task. This is so the compiler knows where to look when you #import <libxml/...>.

How can I embed the OpenEars framework in my application?

How can I embed the OpenEars framework in my application?
When I download the sample project form this website http://www.politepix.com/openears/ it gives me 20 errors and (gcc- exit code 1 error)
If you have any tutorials for this project then please share it with me.
Without any description of what the errors are it's impossible to say what the issue is, but if you look at the first tutorial page for OpenEars here (this is what Jano is referring to):
http://www.politepix.com/openears/gettingstarted
And read onwards from the line "If (and only if) you get multiple build errors, you may have to take one more step of assigning the base SDK for the library and sample app" and follow the instructions and images there step by step, there is a good chance it will help with your problem. I agree with Jano that you should systematically go through the steps in the tutorial starting on the page I've linked and make sure you have downloaded the libraries and run the configuration script just as it says.
Jano, that is odd with the codesigning, I'll look into it.

how to integrate ASIHTTPRequest to iphone project

I am trying to add ASIHTTPRequest library to my iphone project
i followed these lines
Integrating ASIHTTPRequest
ASIHTTPRequest is a powerful open source library written by Ben Copsey from All-Seeing Interactive (and he’s a fellow cocos2d developer too!) It makes it easy to post data and files, and has tons of other great features too like cache support, easy access to HTTP headers, cookie support, and much more.
So let’s add ASIHTTPRequest to our project. Take the following steps:
1. Download the latest version of ASIHTTPRequest.
2. Back in FBFun, right click FBFun under “Groups & Files”, click “Add\New Group”, and name the group “ASIHTTPRequest”.
3. Drag all of the files from the “pokeb-asi-http-request-xxx\Classes” to your new group. Make sure “Copy items into destination group’s folder (if needed)” is checked, and click “Add”.
4. Repeat the above for the 2 files in “pokeb-asi-http-request-xxx\External\Reachability”.
5. Right click the Frameworks folder, and click “Add\Exisitng Frameworks…”. Choose CFNetwork from the list, and click Add.
6. Repeat the above for SystemConfiguration.framework, MobileCoreServices.framework, CoreGraphics.framework and libz.1.2.3.dylib (at the bottom of the list).
7. Compile your project. If it works, you’re integrated!
We’ll explain about how ASIHTTPRequest works when we start to use it. But first, let’s integrate the JSON Framework while we’re at it.
but it not worked for me .while building it showing errors
/Classes/Tests/GHUnitTestMain.m:32:26: error: GHUnit/GHUnit.h: No such file or directory
can anybody help me in this issue
Regards
Thanks
*Edit :
I fixed my problem by following these steps
http://allseeing-i.com/ASIHTTPRequest/Setup-instructions ,
If any one want to integrate ASIHTTPRequest just follow those steps :)*
You will need to add the XML library (it's missing in the instructions), and also make reference to it in the project header search paths with the following:
$(SDKROOT)/usr/include/libxml2