Skip to main content

iOS Uninstall Tracking (APN)

Overview

Track app uninstalls using Apple Push Notification Service (APNs) to measure user retention and optimize your campaigns.

info

iOS uninstalls take 9+ days to appear in reports due to Apple Push Notification service.


Prerequisites

  • iOS 10.0 or higher
  • Xcode 12.0 or later
  • Apple Developer Account
  • Apptrove React Native SDK version 1.6.79+ installed
SDK Version Selection
  • Apptrove SDK (recommended): Use react-native-apptrove and ApptroveSDK.sendAPNToken(apnsToken).
  • Trackier SDK (deprecating May 2026): Use react-native-trackier and TrackierSDK.sendAPNToken(apnsToken).

Step 1: Request Certificate in Keychain Access

1.1. Open Keychain Access on your Mac.

1.2. Go to Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority.

Request Certificate

1.3. Fill in the form:

  • User Email Address: Your email
  • Common Name: Your name
  • Request is: Select Saved to disk
  • Click Continue

1.4. Save the file to your Desktop.

Save to Disk


Step 2: Go to Apple Developer Portal - Identifiers

2.1. Open Apple Developer Portal.

2.2. Go to Certificates, Identifiers & Profiles.

2.3. Click Identifiers.

2.4. Select your App ID (your app's bundle ID/package name).

Identifiers


Step 3: Configure Push Notifications

3.1. After clicking your App ID, you'll see the App ID Configuration page.

3.2. Scroll to Capabilities section.

3.3. Check Push Notifications.

3.4. Click Configure.

Push Notifications Configuration


Step 4: Upload Certificate and Download .cer

4.1. In the Push Notifications configuration screen, choose:

  • Production SSL Certificate (for App Store/Production)
  • Click Create Certificate

4.2. Click Choose File and upload the .certSigningRequest file from Step 1.

4.3. Click Continue.

4.4. Click Download to save the .cer file.

Download .cer Certificate


Step 5: Go to Keychain and Export as .p12

5.1. Double-click the downloaded .cer file to open it in Keychain Access.

5.2. In Keychain Access, click My Certificates in the left sidebar.

5.3. Find your Push Notification certificate (e.g., "Apple Push Services: com.yourapp.package").

5.4. Right-click on the certificate → Select Export.

5.5. Save as:

  • File Format: Personal Information Exchange (.p12)
  • Enter a password (you will need this later)
  • Click Save

Export .p12 Certificate


Step 6: Upload .p12 to Apptrove Panel

6.1. Log in to your Apptrove Panel.

6.2. Go to Settings > Uninstall Tracking.

6.3. Select your iOS app.

6.4. Click Upload and select the .p12 file.

6.5. Enter the password you created in Step 5.

6.6. Click Save.


Step 7: Configure in Xcode

7.1. Open your project in Xcode.

7.2. Select your app TargetSigning & Capabilities tab.

7.3. Click + Capability → Add Push Notifications.

7.4. Click + Capability again → Add Background Modes.

7.5. Check Remote notifications.

Background Modes


Step 8: Add User Permission in Info.plist

8.1. Open your project in Xcode.

8.2. Open the Info.plist file.

8.3. Add the following key and description:

Key: NSUserNotificationsUsageDescription

Value: We need permission to send you notifications and track uninstalls.

You can also add it in the Source Code view:

<key>NSUserNotificationsUsageDescription</key>
<string>We need permission to send you notifications and track uninstalls.</string>
note

This permission message will be shown to users when your app requests notification access.


Step 9: Send Token to Apptrove SDK

9.1 Configure AppDelegate.mm

In your ios/YourProjectName/AppDelegate.mm, initialize Firebase manually to avoid GoogleService-Info.plist dependency if needed:

#import "AppDelegate.h"
#import <FirebaseCore/FirebaseCore.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Manual Firebase configuration
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:@"YOUR_APP_ID" GCMSenderID:@"YOUR_SENDER_ID"];
options.APIKey = @"YOUR_API_KEY";
options.projectID = @"YOUR_PROJECT_ID";
options.storageBucket = @"YOUR_STORAGE_BUCKET";

[FIRApp configureWithOptions:options];

self.moduleName = @"YourProjectName";
self.initialProps = @{};

return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

9.2 React Native Implementation

Retrieve the APN token using @react-native-firebase/messaging and send it to the Apptrove SDK in your App.js.

import { Platform } from 'react-native';
import messaging from '@react-native-firebase/messaging';
import { ApptroveSDK } from 'react-native-apptrove';

const initializeAPNS = async () => {
if (Platform.OS !== 'ios') return;

try {
await messaging().registerDeviceForRemoteMessages();
const authStatus = await messaging().requestPermission();
const enabled = authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
authStatus === messaging.AuthorizationStatus.PROVISIONAL;

if (enabled) {
const apnsToken = await messaging().getAPNSToken();
if (apnsToken) {
console.log('APN Token retrieved successfully:', apnsToken);
ApptroveSDK.sendAPNToken(apnsToken);
}
}
} catch (error) {
console.log('Error initializing APNS:', error);
}
};

9.3 Initialize APNS

note

Important: Call this function after the Apptrove SDK has been initialized.

// Initialize APNS after SDK initialization on iOS
if (Platform.OS === 'ios') {
try {
await initializeAPNS();
} catch (apnsError) {
console.log('Error initializing APNS:', apnsError);
}
}

Step 10: Check Logs

Run your app on a physical device (Simulator doesn't support APNs).

Check Xcode console logs. You should see:

APN Token retrieved successfully: [YOUR_APN_TOKEN]
Apn token Api response saved successfully

Verify Logs

| Success: "Apn token Api response saved successfully"


Troubleshooting

Issue: Token Not Generated

  • Ensure Push Notifications capability is enabled in Xcode.
  • Test on a physical device (not Simulator).
  • Verify user granted notification permission.

Issue: "API Response Failed" Error

  • Check .p12 certificate and password in Apptrove panel.
  • Ensure you are using a Production certificate for App Store builds.
  • SDK must be initialized before calling sendAPNToken.

Complete Flow Summary

  1. Keychain Access → Request Certificate → Save .certSigningRequest file
  2. Apple Developer Portal → Identifiers → Select your App ID
  3. Configure Push Notifications → Enable and click Configure
  4. Upload Certificate Request → Download .cer file
  5. Keychain Access → Export .cer as .p12 with password
  6. Apptrove Panel → Upload .p12 file + password
  7. Xcode → Enable Push Notifications + Background Modes
  8. Info.plist → Add user permission description
  9. React Native App → Call ApptroveSDK.sendAPNToken(apnsToken) or TrackierSDK.sendAPNToken(apnsToken) per your SDK
  10. Check Logs → Verify "Apn token Api response saved successfully"

SDK Method

sendAPNToken(token)

Send the APN token to Apptrove for uninstall tracking.

Usage (Apptrove):

ApptroveSDK.sendAPNToken(apnsToken);

Usage (Trackier):

TrackierSDK.sendAPNToken(apnsToken);

For support, contact support@apptrove.com.