Skip to main content

Get Started

codecov

The iOS PAPulse Analytics Framework is a private library that offers numerous features, including:

  • Collection, storage, and transmission of predefined app-, user-, and network metrics-related information for subsequent analysis and report generation on the backend side
  • A\B experiments management
  • Remote Settings management
  • Revenue tracking

The PAPulse SDK is written entirely in Swift. However, the public API calls are fully compatible with Objective-C code.

How To Install

PAPulse Analytics SDK is compatible with iOS 14.0 and above.

Swift Package Manager

Swift Package Manager is a tool for managing the distribution of Swift code. It's integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Due to PAPulse being a closed proprietary library, it is not available in the public Swift Package Registry. To integrate PAPulse into your Xcode project using Swift Package Manager, you need to add the package from the private Picsart GitLab repository.

Package Information: This package provides PAPulse SDK without ATT support for maximum compatibility across all regions.

Adding via Xcode:

  1. In Xcode, go to FileAdd Package Dependencies...
  2. Enter the repository URL: https://gitlab.com/picsart/di/sdk/pulse-ios.git
  3. Select the version (e.g., tag 3.11.0)

Adding via Package.swift:

dependencies: [
.package(url: "https://gitlab.com/picsart/di/sdk/pulse-ios.git", from: "3.11.0")
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "PAPulse", package: "pulse-ios")
]
)
]

Available Products

Product nameDescription
PAPulseMain analytics functionality including Session Replay (NoATT)
PAPulseSwiftUISwiftUI support (NoATT)
PAPulseAppExtensionFramework for app extensions (NoATT)
Keep in mind

PAPulse version 3.11.0 is required. You should change the version parameter to obtain the desired available version (see CHANGELOG.md).

How To Get Started

Basics

The SDK has a singleton instance that it manages by itself, and that instance lives as long as the app lives. You don't need to worry about retaining the SDK anywhere. You communicate with the SDK with help of static methods of PAAnalytics.

So for example:

PAAnalytics.disableDebugMode()

PAAnalytics module for a regular iOS application

First you need to setup the SDK in order for it to work properly. We suggest doing so in application:didFinishLaunchingWithOptions:. You need supply your application bundle identifier to the SDK:

PAAnalytics.configSet(appName: "com.yourappname.studio")

If you have an app extension that you'd like to share the data (like userID, segments, experiments, language code) with, then use initializer variant with two arguments:

PAAnalytics.configSet(appName: "com.yourappname.studio", groupName: "extension_name")

Ideally, this method should be your first invocation of Pulse Analytics SDK. Otherwise, you should call the public method PAAnalytics.migrateIfNeeded(for:) before further calls of Pulse Analytics SDK functions or getting properties, which are placed before aforementioned PAAnalytics.configSet(appName:groupName:).

Call start to start session, logging and sending info to server.

PAAnalytics.start()

PAExtensionAnalytics module for regular iOS app extension

The first argument is app group that is used for creating shared defaults and pass the data between main app and extension. The second argument is your host application bundle identifier. The third argument is the app extension's desired name that helps identify and analyze fired events sequence in the web dashboard.

PAExtensionAnalytics.configSet(groupName: "group_name", appName: "com.yourappname.studio", extensionName: "extension_name")