Installing the Freshpaint iOS SDK

To install the Freshpaint iOS SDK, add the following to your app's Podfile:

pod 'Freshpaint', '0.2.1'

Then run:

pod install --repo-update

To import the Freshpaint SDK use:

import FreshpaintSDK

Then to initialize the SDK, add the following code to your application delegate's didFinishLaunchingWithOptions:

func application(
    _ application: UIApplication, 
    didFinishLaunchingWithOptions 
    launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    ...
    let config = FreshpaintConfiguration(writeKey: "<your environment id>");
    config.trackApplicationLifecycleEvents = true
    config.recordScreenViews = true
    Freshpaint.setup(with: config)
    ...
}

You can get your environment id by going to the Freshpaint sources page.

Verifying Your Instrumentation

To verify your Freshpaint installation, navigate to the Freshpaint Live View. After opening your app, you should see an Application Opened event show up in Live View:

Note, the Freshpaint SDK batches events, so it can take a minute for the event to show up.

Last updated