Swift + UIKit with Scenes

If your application is written in Swift and uses UIKit as the entry point to the UI, and uses Scenes, having a SceneDelegate file, follow these steps: ​

  1. Open the SceneDelegate file and add the import PulseLabsFlightRecorderSDK statement to the top of the file:

    SceneDelegate.m
    import UIKit
    
    // Insert the import statement:
    import PulseLabsFlightRecorderSDK
    
    class SceneDelegate: UIResponder, UIWindowSceneDelegate {
  2. Add the FlightRecorderSDK.start(apiKey: "YOUR_API_KEY") line of code in the sceneDidBecomeActive(_:) delegate method, replacing "YOUR_API_KEY" with your own API key. There are also other parameters that are optionals: - customFontsLib: you can also create an instance of FlightRecorderCustomFontsLib as pass it here. The sdk then will use that font to decorate the native part of the feedback form

    SceneDelegate.m
    func sceneDidBecomeActive(_ scene: UIScene) {
        
        // Insert the FlightRecorderSDK.start statement:
        FlightRecorderSDK.start(apiKey: "YOUR_API_KEY",
                        customFontsLib: FlightRecorderCustomFontsLib?)
    }

The SDK is now installed! Run your app on a real device (the SDK will not work in a simulator) and the introduction screen will appear on the first run. You can then shake or take a screenshot to capture the video content and send a report.

If you have any issues, head to the Troubleshooting section.

Last updated