With Leanplum variables, you can control your app's data remotely without having to resubmit the app to the App Store. Any data type in your app can be tagged as a variable. Those values will then automatically sync to our servers.
Some of these data types can include floats, booleans, strings, arrays, dictionaries, etc. You can also create A/B tests to change variables for only a percentage of your users, and test the effect of those changes.
There are two ways to add variables to your app:
- Define the variables in your app’s code, then run a Debug build on a registered developer device (Recommended method)
- Via the REST API, using the setVars action
In this article, we'll show you how to add variables using the first method. If you would like to add variables using the REST API, see setVars.
If you click Variables in the left side nav bar you will see all of the variables from your app that have been tagged and synced to Leanplum. The variable values that are hard-coded into your app are represented in the Defaults in Code column. The Overrides column is where you can modify those values for all or a segment of your users.
After running a debug build on a registered developer device, click the refresh icon at the top of the Defaults in code column. This will update any newly tagged variables and modify existing values to reflect changes since you last synced variables.
If for any reason you or someone on your team is running an older version of your app with different variables, do not update variables, as this would cause your current variables to be overwritten.
For more information about variables, please review Modeling structured data in our developer documentation.
Updated 2 years ago