Launch Params
With Launch Params, you can pass custom data to your mobile apps while running in Appetize. It can be useful to load custom content, skip onboarding, auto-login a specified user, or custom tracking.
Set the params data to pass to your application. The data needs to be an URL-Encoded JSON Object e.g.
¶ms={"foo":"bar"}
should be encoded to
¶ms=%7B%22foo%22%3A%22bar%22%7D
Send the params data to pass to your application as part of the configuration. The data needs to be a JSON Object e.g.
await client.config({
params: {"foo":"bar"},
...
})
For convenience, we set the key
"isAppetize": true
while streaming your app to allow you to easily detect if your app is running in Appetize.Android (Java)
Android (Kotlin)
iOS (ObjC)
iOS (Swift)
With Intents
The data will be passed as extras into the intent that launches your app, accessible by calling the appropriate get method (based on type) e.g.
Intent intent = getIntent()
intent.getBooleanExtra("isAppetize", false);
intent.getStringExtra("stringKey");
...
With SharedPreferences
The data will also be stored in SharedPreferences under a file called
prefs.db
. This is accessibly by fetching that SharedPreferences
instance and calling the appropriate get method e.g.SharedPreferences preferences = getApplicationContext().getSharedPreferences("prefs.db", Context.MODE_PRIVATE);
preferences.getBoolean("isAppetize", false);
preferences.getString("stringKey", null);
...
With Intents
The data will be passed as extras into the intent that launches your app, accessible by calling the appropriate get method (based on type) e.g.
intent.getBooleanExtra("isAppetize", false)
intent.getStringExtra("stringKey")
...
With SharedPreferences
The data will also be stored in SharedPreferences under a file called
prefs.db
. This is accessibly by fetching that SharedPreferences
instance and calling the appropriate get method e.g.val preferences = applicationContext.getSharedPreferences("prefs.db", Context.MODE_PRIVATE);
preferences.getBoolean("isAppetize", false)
preferences.getString("stringKey", null)
...
The data passed will be stored in the shared defaults object, accessible by calling the appropriate method (based on type) e.g.
[[NSUserDefaults standardUserDefaults] boolForKey:@"isAppetize"]
[[NSUserDefaults standardUserDefaults] objectForKey:@"objectKey"]
[[NSUserDefaults standardUserDefaults] stringForKey:@"stringKey"]
...
Note that extension bundles will not have access to the app's standard
UserDefaults
. To work around this issue, please see Sharing Data with Your Containing App.The data passed will be stored in the shared defaults object, accessible by calling the appropriate method (based on type) e.g.
UserDefaults.standard.bool(forKey: "isAppetize")
UserDefaults.standard.object(forKey: "objectKey")
UserDefaults.standard.string(forKey: "stringKey")
...
Note that extension bundles will not have access to the app's standard
UserDefaults
. To work around this issue, please see Sharing Data with Your Containing App.Last modified 7d ago