Skip to main content

Forward in-app purchases on iOS

When users make an in-app purchase, we receive data in three ways:

  1. The justtrack SDK, when properly configured, forwards the transaction to our backend.
  2. For one-time purchases, our backend uses an API request to verify the transaction.
  3. For subscriptions, Apple sends an in-app purchase event notification to our backend.

In this guide, you'll learn how to configure your accounts in justtrack and App Store Connect so we can receive the necessary data from each of these sources.

SDK setup

Read our iOS, React Native, or Unity SDK documentation for setup instructions.

Look up your shared secret

In order to verify one-time purchases, you need to configure a shared secret. This will allow us to make API calls on behalf of your app. There are two types of shared secrets you can configure for your iOS account:

  • App-specific: This is used only for the app for which it's configured.
  • Global: This is used if no app-specific secret is configured.

App-specific shared secret

info

If you prefer to use your global shared secret, you can skip this section.

In App Store Connect:

  1. Click App Information
  2. Under App-Specific Shared Secret, click Manage
Location of the app-specific shared secret

If you don't have an app-specific shared secret configured, generate one:

Generating an app-specific shared secret

Now, you're presented with the 32-character, hexadecimal shared secret. Copy this so you can pass this to the justtrack platform in the next section.

Global shared secret

info

If you already have an app-specific shared secret, you can skip this section.

In App Store Connect:

  1. Click Users and Access
  2. Click Shared Secret
  3. Generate a new shared secret or find your existing secret
Global shared secret for your App Store Connect account.

Copy this so you can pass this to the justtrack platform in the next section.

Configure your shared secret in justtrack

Now that you have a shared secret, you need to enter it in justtrack.

In justtrack, navigate to Admin > Apps:

Navigate to apps

Here, you'll find the list of apps connected to your justtrack account. Next to the app for which you want to verify purchases, click See Details.

Now, you're in the App Hub. From here, you can configure how you monetize your app. On the Monetization card, click Manage Integration:

Manage monetization integrations

On the Monetization page, click Purchase verification credentials:

Purchase verification credentials

Here, you'll paste the secret you copied in the last section. In the App Hub, you'll see an indication that you've successfully set up in-app purchase tracking. You can now start forwarding in-app purchases from the iOS, React Native, or Unity justtrack SDKs, and you'll see the revenue you make from them on the justtrack dashboard.

Provide the notifications URL

For subscriptions, you need to give Apple a justtrack URL so we receive the in-app purchase notifications.

  1. In App Store Connect, navigate to General > App Information.
  2. Under App Store Server Notifications, click Set Up URL.
  3. Provide this URL: https://iap.justtrack.io/appleappstore/v2
  4. Select V2 Notifications (This is important!)
App Store Connect setup