How to integrate flurry into ios using a fast language

I want to integrate flurry into ios using a fast language. I added flurry sdk two files: flurrylib.a and flurry.h, and then entered my api key into the TestProject4-Bridging-Header.h project

#import "Flurry.h" 
+6
source share
4 answers

I had the same issue and adding the bridge header worked for me. Here are the steps I followed.

Note. If you already have a bridge file, skip steps 2 through 4

  • I dragged the Flurry folder into my Swift iOS project in Xcode.
  • I created a header file with a bridge by creating a new Objective-C header file (in the Xcode menu it is File / New / File / iOS / Source / Header file)
  • I named the file name "PROJECTNAME-Bridging-Header.h" (replace PROJECTNAME with your Xcode project name)
  • In the project build settings, I looked for "Swift Compile - Code Generation" and there in the "Objective-C Bridging Header" I entered the name of my new bridge file (PROJECTNAME-Bridging-Header.h) for debugging and releasing the value.
  • Now, in my bridge header file, I referenced the Flurry header file.

    #import "Flurry.h"

  • In my AppDelegate.swift file, I could call 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 this helps someone.

+19
source

If you try to register events in 'doneFinishLaunchingWithOptions' using the Flurry SDK 6.0.0, this is not possible due to an error in this version of the SDK. However, you can start a session from this function. I was told this information by a Flurry support representative and confirmed this in my own testing.

+2
source

Fleet Integration Using Pods in Swift

You need to import the 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") } 
+2
source

You need to add the bridge title to your project. In this header, you import what you need in Swift, and then you do not need to import it anywhere. IBook using Swift and Obj-C has a very good explanation.

Actually, the Apple Swift blog has an explanation:

To be safe, all components of your application must be built with the same version of Xcode and the Swift compiler to ensure they work together.

You can find more information here .

0
source

Source: https://habr.com/ru/post/975220/


All Articles