Apple App Tracking Transparency

📘

Configure your app to be compliant with Apple's User Privacy and Data Use Policies using the AppTrackingTransparency Framework.

For iOS 14.5+ all apps must obtain explicit consent from the user if your app collects and shares user data with other companies for the purposes of tracking across apps and web sites.

Fortunately GoNative makes it easy for you to configure your app to utilize Apple's AppTrackingTransparency Framework to remain compliant.

  1. Set the appConfig parameter permissions.iOSATTUserTrackingDescription to define a NSUserTrackingUsageDescription that provides a description of the tracking request to users. You can use the GoNative default description or set your own.

  2. Set the appConfig parameter permissions.iOSRequestATTConsentOnLoad to trigger the ATT prompt automatically when the app is loaded. Or use the GoNative JavaScript Bridge command to trigger at run time.

  3. Use the result of the user's consent to adjust the tracking you perform based on the user's response per the below callbacks.

//Default prompt: Your data will be used to personalize your experience 
//and at times to deliver personalized ads
{
  "permissions":{
    "iOSATTUserTrackingDescription": true,
    "iOSRequestATTConsentOnLoad": true
  }
}
{
  "permissions":{
    "iOSATTUserTrackingDescription": "Your data will be used to provide personalized recommendations"
  }
}

Note: permissions.iOSATTUserTrackingDescription must be set in appConfig.json for the following commands to run successfully:

↔️GoNative JavaScript Bridge

To request consent at run time manually:

gonative.ios.attconsent.request({'callback':cb});

To check wither consent was obtained (either through the manual prompt or automatic prompt):

gonative.ios.attconsent.status({'callback':cb});

In both cases cb will be called with { granted: true|false } based on the user's response to the consent prompt.

Note: For iOS 14.4 and lower cb will always be called with { granted: true}

Learn more about the AppTrackingTransparency Framework.