This PR adds functionality to provide app keys by xml file.
Implementation
If client hasn't set the app keys before calling Leanplum.start they are loaded from Android string resources.
You can provide them by creating app/src/main/res/values/leanplum-app.xml containing:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="leanplum_app_id">APP_ID</string>
<string name="leanplum_prod_key">PROD_KEY</string>
<string name="leanplum_dev_key">DEV_KEY</string>
<!-- Environment is 'production' or 'development' -->
<string name="leanplum_environment">ENVIRONMENT</string>
</resources>
Note that using another approach like external file (json or xml) adds a lot of complication to the codebase because you must do all I/O operations on a background thread but Leanplum.start is running partially on the UI thread.
Background
This PR adds functionality to provide app keys by xml file.
Implementation
If client hasn't set the app keys before calling
Leanplum.start
they are loaded from Android string resources.You can provide them by creating
app/src/main/res/values/leanplum-app.xml
containing:Note that using another approach like external file (json or xml) adds a lot of complication to the codebase because you must do all I/O operations on a background thread but
Leanplum.start
is running partially on the UI thread.