If you want to make a change to the first view of your app for first-time users on the initial app launch, it's possible Apptimize is not able to download the necessary resources in time and will instead present the default view. For experiments can result in a low participation rate. If users do not receive the experiment information in time, Apptimize will not enter them into an experiment. To ensure that users are able to participate in time, simply introduce a small delay to the app's start-up process using the following APIs.
There are 3 options for setting a delay in iOS. You could use any of these 3 options to set a delay until Apptimize configuration data (aka metadata) is downloaded.
- ApptimizeDelayUntilTestsAreAvailable: This option allows you to delay the initialization of Apptimize while the initial experiment configuration file is fetched, up to a maximum value of milliseconds specified in your Info.plist file. This is the preferred method for setting a delay for visual experiments.
- Use the waitForTestToBecomeAvailable API call on the loading screen or App Delegate (please use this method on the main thread only). This is the preferred method for setting a delay in dynamic variable or code block experiments.
- Use ApptimizeUpdateMetadataTimeoutOption in runTest function for a code block experiment.
Use the setUpdateMetadataTimeout in ApptimizeOptions during initialization to set a delay in Android.
This delay sets a maximum time for your app to wait for Apptimize data to be loaded onto the device. For example if it is set to 800 milliseconds, your app will wait at most 800 milliseconds for Apptimize data. If the data is downloaded before this set time is reached, then Apptimize proceeds with other initialization steps and does not wait any further.
We recommend an 800 millisecond delay for experiments without heavy resources (e.g. images). If your experiment does include images to be shown as soon as the app opens, we recommend also factoring in how long it might take to download those resources.