For the complete documentation index, see llms.txt. This page is also available as Markdown.

Launch Arguments

Pass arguments to an iOS app at launch and read them with ProcessInfo or UserDefaults.

Passing Data to your Application

Launch arguments pass strings to your iOS app when it starts. For example, pass -userId, 123 to provide a user ID.

With Query Parameter

Set the launchArgs data to pass to your application. The data must be a URL-encoded JSON array of strings:

&launchArgs=%5B%22-userId%22%2C%22123%22%5D

This decodes to:

["-userId", "123"]

See launchArgs for more information.

With JavaScript SDK

Send launchArgs to your application as part of the configuration:

await client.setConfig({
    launchArgs: ["-userId", "123"],
    // Rest of the configuration
})

See launchArgs for more information.

Retrieving Data in your Application

Launch arguments never persist data. They apply only to the current launch.

To read values with UserDefaults, pass each value as a -key, value pair. The key must start with -.

These values use the volatile argument domain. They do not write to persistent UserDefaults. They override stored values with the same key for this launch.

Read any launch arguments with ProcessInfo.processInfo.arguments.

For iOS values read through UserDefaults, launch arguments provide a faster launch than Launch Params.

Last updated