Table of Contents

Privacy

The Privacy module lets you ask users for legal tracking consent, according to GDPR and CCPA laws. It also manages App Tracking Transparency (ATT) consent on iOS.

Overview

This module manages user legal consent using Google User Messaging Platform. It will request user tracking consent at the start of the first session of the game, if the player is in a region where data protection is required by law.

It also provides an API to read user's decision, as well as opening a window for the player to edit their choices.

Usage

The first consent request and the App Tracking Transparency (ATT) pop-up open automatically at the start of the game. To allow users to edit their preferences later, games' settings menu must feature a button to open the consent management window:


public class SettingsPanelController : MonoBehaviour 
{
    public Button PrivacySettingsButton;

    private void Start() 
    {
        if (PrivacyService.Instance.RegionRequiresConsentManagement())
            PrivacySettingsButton.onClick.AddListener(OpenConsentManagementWindow);
        else
            Destroy(PrivacySettingsButton.gameObject);
    }
    
    private async void OpenConsentManagementWindow()
    {
        await PrivacyService.Instance.ShowConsentManagement();
    }
}

The Privacy module recognizes four different types of consent:

  • Terms and conditions
  • Tracking
  • Ads tailoring
  • Minimum required age consent

PrivacyService.Instance.GetConsentStatus(ConsentKind) will give the status of any of these consent types. Additionally, PrivacyService.Instance.ConsentStatusChanged is invoked every time the consent status changes for a consent type.

The consent request screen will open automatically at the start of the sessions when it is required: in the first session after install, as well as any session after the list of tracking partners changed.

The consent request screen is one of the first operations of Homa SDK initialization. It opens automatically, but the SDK's initialization can be delayed by implementing ISdkInitializationSemaphore in the game:

[Preserve]
public class HomaSdkInitializationSemaphore : ISdkInitializationSemaphore
{
    private static readonly TaskCompletionSource<bool> TaskCompletionSource = new();
    
    public Task WaitUntilReady() => TaskCompletionSource.Task;
    
    public static void StartHomaSdkInitialization() 
    {
        TaskCompletionSource.TrySetResult(true);
    }
}

Configuring the App Tracking Transparency pop-up

The App Tracking transparency pop-up can be configured using the Privacy module's project settings, under HOMA/Privacy.

Note

Any change to the Privacy configuration other than changing the ATT pop-up message may cause the App Store to reject your game update.

In the “App Tracking Transparency” section, the following options are available for customizing when and how the ATT pop-up is shown:

  • Pop-up message: Customize the content of the ATT pop-up.
  • Show pop-up timing: Specify whether the ATT pop-up should appear before or after the tracking consent request.
  • Show pop-up if ads tailoring consent was declined: By default, the ATT pop-up will not appear if the player declines ad-related tracking. Enabling this option will force the ATT pop-up to always appear. This option only applies if the pop-up timing is set to "After ads tailoring consent".