React Native SDK - Supporting SKAdNetwork

Introduction: SKAdNetwork and SKAN

Singular’s iOS SDK simplifies SKAdNetwork integration, supporting SKAN 4.0 features like multiple postbacks, hierarchical source IDs, and coarse-grained conversion values. Based on Singular’s open-source SKAN standard, it ensures easy setup and compatibility with ad networks. For setup details, see Singular’s SKAdNetwork Guide.


Supporting SKAdNetwork Tracking

Tip: SKAdNetwork tracking is enabled by default when using the Singular SDK.

To disable or turn off the support for SKAdNetwork:

  • Set the skAdNetworkEnabled configuration method to FALSE when building the SingularConfig object.

Handling AppTrackingTransparency (ATT)

For iOS 14.5+ (including iOS 18), use ATTrackingManager to request user consent before accessing the IDFA for tracking. Singular’s iOS SDK (v12.x) supports ATT, allowing initialization before consent and delaying events until consent is granted or a timeout occurs. This ensures compliance with Apple’s privacy rules and compatibility with SKAdNetwork (SKAN) 4.0.

Implementation

  1. Add ATT Framework:

    • Include AppTrackingTransparency in your Xcode project.
    • Update Info.plist with NSUserTrackingUsageDescription (e.g., "This app uses tracking to personalize ads.").
  2. Request ATT Consent:

    • Prompt for consent when the app launches or after onboarding, based on your UX strategy.
    • Use Singular’s SDK to handle pre-consent initialization.
  3. Configure Singular SDK:

Best Practices

  • Prompt Timing: Request ATT consent on app launch to maximize IDFA availability, or delay until after onboarding to improve user context. Test both to balance consent rates and UX.
  • Timeout: Set waitForTrackingAuthorizationWithTimeoutInterval to 30-300 seconds. Post-timeout, Singular proceeds with SKAN 4.0 attribution (no IDFA).
  • SKAN 4.0 Integration: Ensure conversion value updates align with ATT consent to optimize SKAN postbacks (e.g., use Singular’s dashboard for mapping events to values 0-63).
  • Error Handling: Check ATTrackingManager.trackingAuthorizationStatus for restricted (e.g., parental controls) or notDetermined states and log for analytics.

Manual Conversion Value Handling

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:

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.