I want to integrate flurry in ios using swift language. I added the flurry sdk\'s two files : flurrylib.a and flurry.h and then entered my api key in project TestProject4-Br
Flurry Integration using Pods in Swift
You need to import Flurry SDK as Follows
import Flurry_iOS_SDK
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Flurry.startSession("YOUR_API_KEY")
Flurry.logEvent("Started Application")
}
If you are attempting to log events in the 'didFinishLaunchingWithOptions' using Flurry SDK 6.0.0, this is not possible due to a bug in that version of the SDK. It is possible to start a session from this function however. I was told this information by a Flurry support rep, and confirmed it in my own testing.
You need to add a bridging header to your project. In that bridging header you import what you need in Swift and then you don't need to import it anywhere else. The iBook on using Swift and Obj-C alongside has a very good explanation on this.
Actually, there is an explanation on Apple's Swift blog that says:
To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.
You can find more information here.
I had the same issue and adding a bridging header worked for me. Here are the steps I followed.
Note: If you already have a bridging file, skip the steps 2 to 4
Now, back in my bridging header file, I referenced the Flurry header file.
#import "Flurry.h"
In my AppDelegate.swift file, I could then call the Flurry methods using Swift:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// setup Flurry
Flurry.startSession(flurryKey) // replace flurryKey with your own key
Flurry.setCrashReportingEnabled(true) // records app crashing in Flurry
Flurry.logEvent("Start Application") // Example of even logging
Hope it helps someone.