Uninstall Tracking Setup - iOS SDK (v4)

Note

This guide provides instructions for installing and setting up the iOS SDK v4. For earlier versions, consult the iOS SDK (Previous) guide.

Airbridge sends silent push notifications to users who have performed any app event at least once in the past 6 months to check if they have deleted the app. These notifications are sent daily between 3:00 PM and 4:00 PM (UTC). Uninstall events can be monitored in the Airbridge reports and raw data export files.

Submit Credentials

Submit your Apple Developer credentials to Airbridge.

Get credentials from Apple Developer Portal

Follow the steps below to get the required credentials from the Apple Developer Portal.

Submit credentials to Airbridge

Follow the steps below to submit the credentials to Airbridge.

1. Navigate to [Settings]>[Uninstall Tracking] in the Airbridge dashboard.

2. Select the [iOS] tab.

3. Submit the required credentials.

Select app environment

After submitting all the required credentials to Airbridge, select the app environment to collect push tokens.

Different push tokens are collected depending on the app environment you choose. For example, push tokens collected in the production environment cannot be used in the development environment.

Test silent push notifications

Test silent push notifications to make sure the notifications are successfully sent to the devices. To proceed with the test, click Test silent push. The silent push test does not measure or generate uninstall events; therefore, uninstalls cannot be confirmed in the Airbridge dashboard.

Conducting the silent push test is recommended as the Bundle ID, which is one of the required credentials for uninstall tracking, can only be validated through the silent push test.

To conduct a silent push test, you need an APNs push token (device token). The push token you collect varies depending on the app environment. You need to check the push token and the app environment before proceeding with a silent push test. Refer to the Apple Developer Documents for instructions on how to find the APNs push token.

Upon sending a silent push to a device from Airbridge, you can check for a success message or an error code. The main error codes that can be received are as follows. For more information about the error codes, refer to the Apple Developer Documents.

Attention

You cannot conduct silent push tests on the iOS Simulator.

Set Up the Airbridge SDK

To track uninstalls on iOS devices, you need to set up identifiers to allow silent push notifications in the app and add capabilities. Also, you need to add code to ignore silent push notifications that are aimed at tracking app deletions.

Add capabilities

1. Navigate to [Project File]>[Signing & Capabilities] in Xcode.

2. Click + Capability and select Push Notifications. Then select Background Modes and check "Remote Notification."

Enable push notifications

You can enable push notifications using the registerForRemoteNotifications function. If you have not used push notifications before, call this function.

1234567
func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool
{
    ...
    UIApplication.shared.registerForRemoteNotifications()
    ...
}

After the setup, the application(_:didFinishLaunchingWithOptions:) function is called every time a push notification, including silent push notifications, is sent. When a silent push notification is sent, this function is called after the app is backgrounded. Even if the app is foregrounded afterward, the function will not be called again.

You can check whether the application(_:didFinishLaunchingWithOptions:) function was called using launchOptions. Refer to the code below.

12345678
func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    let key = UIApplication.LaunchOptionsKey.remoteNotification
    let isLaunchRemoteNotification: Bool = launchOptions?[key] != nil
}

Send the APNs push token

When the APNs Push Token is generated, call the registerPushToken function to pass it to the SDK.

12345
func application(_ application: UIApplication,
                 didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
    AirBridge.registerPushToken(deviceToken)
}

Additional configuration for ignoring Airbridge silence push notifications

The silent push notifications Airbridge sends for uninstall tracking should not be displayed in the user's app. By adding the exception handling code as below, the silent push will not be exposed to the user.

12345678910
func application(_ application: UIApplication,
                 didReceiveRemoteNotification userInfo: [AnyHashable : Any],
                 fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
{
    if Airbridge.isUninstallTrackingNotification(userInfo) {
        return
    }
  
    ...
}

Enable Uninstall Tracking

Once you submit the credentials to the Airbridge dashboard and complete the Airbridge SDK setup, you can switch on the "Enable uninstall tracking" toggle. When switching on the toggle, Airbridge starts tracking uninstalls.

To learn more about uninstall tracking, refer to this Airbridge user guide.

Was this page helpful?

Have any questions or suggestions?