The First Session Delay feature allows you to delay SDK initialization during the very first SDK session only. While in this delay mode, the Adjust SDK records all activity (such as installs and events) in memory, but does not transmit any data to Adjust servers.
This gives your app an opportunity to gather additional data that may not be available at launch and, if needed, modify the SDK configuration before any data is sent.
When and Why to Use First Session Delay
Use this feature if you need to:
Set COPPA compliance for the user.
Indicate that the user falls under the Play Store’s “Designed for Families” (kids) category.
Assign an external device ID.
Enabling First Session Delay
To initialize the SDK in delayed mode, use the following setup:
val appToken = "{YourAppToken}"
val environment = AdjustConfig.ENVIRONMENT_SANDBOX
val config = AdjustConfig ( this , appToken, environment)
config. enableFirstSessionDelay ()
String appToken = "{YourAppToken}" ;
String environment = AdjustConfig.ENVIRONMENT_SANDBOX;
AdjustConfig config = new AdjustConfig ( this , appToken, environment);
config. enableFirstSessionDelay ();
After this, the SDK will be initialized in memory and will not process anything until you explicitly call:
Adjust. endFirstSessionDelay ()
Adjust. endFirstSessionDelay ();
注意
The delay only occurs during the install session of the SDK (i.e., the first-ever SDK initialization).
The delay will end only when endFirstSessionDelay is called. If it is not called during the app’s runtime, any delayed calls will be lost upon app restart. The next SDK initialization will then be treated as a first session again, and the SDK will initialize in delayed mode once more.
Once the delay has ended or is no longer applicable (e.g., in subsequent sessions), any calls to enableFirstSessionDelay or endFirstSessionDelay will be ignored.
Configuration changing while on delay
While the SDK is in first session delay mode, it is possible to change COPPA compliance, as if it were set in the config during initSdk
.
To enable COPPA compliance:
Adjust. enableCoppaComplianceInDelay ()
Adjust. enableCoppaComplianceInDelay ();
To disable COPPA compliance:
Adjust. disableCoppaComplianceInDelay ()
Adjust. disableCoppaComplianceInDelay ();
While the SDK is in first session delay mode, it is possible to set the external device ID, as if it were configured during initSdk
.
To set the external device ID:
Adjust. setExternalDeviceIdInDelay ( "{YourExternalDeviceId}" )
Adjust. setExternalDeviceIdInDelay ( "{YourExternalDeviceId}" );
While the SDK is in first session delay mode, it is possible to change Play Store kids compliance, as if it were set in the config during initSdk
.
To enable Play Store kids compliance:
Adjust. enablePlayStoreKidsComplianceInDelay ()
Adjust. enablePlayStoreKidsComplianceInDelay ();
To disable Play Store kids compliance:
Adjust. disablePlayStoreKidsComplianceInDelay ()
Adjust. disablePlayStoreKidsComplianceInDelay ();
注意 Similar to the methods for configuring and ending the first session delay, once the delay has ended or is no longer applicable (e.g., in subsequent sessions), any calls to methods that allow configuration changes during the delay will be ignored.