Skip to main content
Launch parameters allow your app to receive data at launch, enabling you to simulate different user journeys and configurations during automated tests. For convenience, MobileBoost sets the key isGptDriver: true when running your app on the platform, so you can easily detect if your app is running in a test environment.

Retrieving launch parameters

Launch parameters are stored in UserDefaults and can be accessed by calling the appropriate method based on type:
UserDefaults.standard.bool(forKey: "isGptDriver")
UserDefaults.standard.object(forKey: "objectKey")
UserDefaults.standard.string(forKey: "stringKey")

Passing launch parameters via API

To pass launch parameters when triggering tests, include a launchParams object in your JSON payload to the execute tests endpoint:
{
    "organisationId": "<ORG_ID>",
    "uploadId": "<UPLOAD_ID>",
    "launchParams": {
        "<KEY1>": "<VALUE1>",
        "<KEY2>": "<VALUE2>"
    },
    "testIds": [
        "<TEST_ID>"
    ]
}
The launchParams object accepts any number of key-value pairs based on your requirements.

Example

Passing a version and featureFlag parameter:
{
    "organisationId": "org12345",
    "uploadId": "upl67890",
    "launchParams": {
        "version": "1.2.0",
        "featureFlag": "true"
    },
    "testIds": [
        "test01",
        "test02"
    ]
}
With this setup, the defined launch parameters will be passed to your app when running tests, allowing you to simulate various conditions and configurations during execution.