Unity SDK: Adding SKAdNetwork Support

Singular Unity SDK
Download
Singular Unity SDK version 4.0.14 (see Change Log)
Compatibility Unity 4.7.2+
Sample App Review our sample app for an example of a complete SDK integration based on best practices.
Integration Guides
  1. Basic Integration
  2. Tracking Events and Revenue
  3. Implementing Deep Links
  4. Adding SKAdNetwork Support
  5. Advanced Options

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.

Implementing SKAdNetwork in the Unity SDK

SingularSDKObject Settings

You can configure the following options in the SingularSDKObject. For more information about each of these options, see the iOS SDK SKAdNetwork implementation guide.

Option Default
Description
SKANEnabled False Set to true to enable SKAdNetwork support.
manualSKANConversionManagement False Set to true if you want to manage the conversion value manually.

Methods

SingularSDK.SkanRegisterAppForAdNetworkAttribution Method
Description

Enable SKAdNetwork support (equivalent to setting SKANEnabled=true in the SingularSDK object).

Note:

  • If you've already enabled SKAdNetwork through the SingularSDK object, you don't need to call this method.
  • Calling this method overrides the configured value.
Signature public void SkanRegisterAppForAdNetworkAttribution()
Usage Example
SingularSDK.SkanRegisterAppForAdNetworkAttribution();
SingularSDK.SkanUpdateConversionValue Method 
Description

Update the SKAdNetwork conversion value.

Note: Use this method if you have selected to update the SKAdNetwork conversion value manually. This method will work only if manualSKANConversionManagement is set to True.

Signature public void SkanUpdateConversionValue(int value)
Usage Example
// A sign-up event happened
Singular.Event("SignUp");

// Update the conversion value to 7
SingularSDK.SkanUpdateConversionValue(7);
SingularSDK.SkanGetConversionValue Method 
Description Get the current conversion value tracked by the Singular SDK.
Signature public int? SkanGetConversionValue()
Usage Example
int? value = SingularSDK.SkanGetConversionValue();
SingularSDK.SetConversionValueUpdatedHandler Method 
Description Set a handler to receive notifications when the conversion value is updated.
Signature public void SetConversionValueUpdatedHandler(SingularConversionValueUpdatedHandler handler)
Usage Example
public class Main : MonoBehaviour, SingularConversionValueUpdatedHandler {
  void Awake() {
    SingularSDK.SetConversionValueUpdatedHandler(this);
  }

  void OnConversionValueUpdated(int value) {
    // Use the conversion value
  }
}