React Native SDK: Adding SKAdNetwork Support

Introduction: SKAdNetwork and SKAN

SKAdNetwork is Apple's new framework for attributing mobile installs without compromising the end-user's privacy. Singular's new version of the iOS SDK helps you implement SKAdNetwork seamlessly and with minimal engineering effort. This SKAdNetwork implementation is based on SKAN - a standard developed by Singular for a smooth implementation of SKAdNetwork.

For a full guide to Singular's SKAdNetwork implementation, see the iOS SDK SKAdNetwork implementation guide.

Enabling SKAdNetwork Tracking

To enable SKAdNetwork tracking for your app, turn on the skAdNetworkEnabled configuration option before initializing Singular:

const config = new SingularConfig('<SDK KEY>', '<SDK SECRET>');

// Enable SKAdNetwork
config.withSkAdNetworkEnabled(true);

// Register to a callback for when the conversion value is updated
config.conversionValueUpdatedHandler(value => {
	console.log(`Updated conversion value: ${value}`);
  });

Singular.init(config);

Handling Conversion Value Updates

Managed Mode

By default, the SKAdNetwork implementation manages the conversion value directly from the Singular server side.

This allows for maximum flexibility as you can set and change your conversion values through the Singular platform, without modifying your client-side code.

This server-side managed mode also helps you deal with the SKAdNetwork timers. SKAdNetwork allows you to update the conversion value within 24 hours from the time of registration to SKAdNetwork. Any call to update the conversion value extends the timer by 24 more hours. Therefore, when choosing your conversion events, you'll have to make sure the events happen within that update window. In managed mode, you can change the conversion event configuration at any time, without releasing a new version of your app.

Manual Mode

If you want to update the conversion value on your own in the app code, call withManualSkanConversionManagement when you initialize the SDK:

const config = new SingularConfig('<SDK KEY>', '<SDK SECRET>');
// Enable SKAdNetwork
config.withSkAdNetworkEnabled(true);

// Enable manual conversion value updates
config.withManualSkanConversionManagement();

Singular.init(config);

Then, to update the conversion value, use the skanUpdateConversionValue method wherever needed in your app's lifecycle:

skanUpdateConversionValue Method (JavaScript)
Description Manually update the SKAdNetwork conversion value.
Signature Singular.skanUpdateConversionValue(conversionValue)
Usage Example
// signup event happened
Singular.event("SignUp");

// update conversion value to 7
Singular.skanUpdateConversionValue(7);

Note: The skanUpdateConversionValue method will not function if you have not set the SDK to manual updates on initialization. 

Retrieving the Conversion Value

To get the current conversion value, use the skanGetConversionValue method. This method works in both managed and manual mode.

skanGetConversionValue Method (JavaScript)
Description Get the current conversion value tracked by the Singular SDK.
Signature Singular.skanGetConversionValue()
Usage Example
const conversionValue = Singular.skanGetConversionValue();

Other iOS 14 Updates

See Handling AppTrackingTransparency Consent.

Integration Guides
  1. Basic Integration
  2. Tracking Events and Revenue
  3. Implementing Deep Links
  4. Adding SKAdNetwork Support
  5. Advanced Options