Setting up Android Enterprise's AMAPI, i have an application that needs to receive information from the AMAPI service (such as urls and texts), when refering to the documentation for Managed Configurations set up in ApplicationPolicy, it states that These are arbitrary settings that can be changed by a managed configuration provider
. In order to change the restrictions set up in my xml file, done as the doc instructs:
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:key="test"
android:title="test"
android:restrictionType="string"
android:description="@string/app_name"
android:defaultValue="defaultValue"/>
</restrictions>
we've added a ManagedConfigurationTemplate into our ApplicationPolicy with the values needed:
"managedConfiguration": null,
"managedConfigurationTemplate": {
"configurationVariables": {
"test": "string"
},
"templateId": null
},
"minimumVersionCode": null,
"packageName": "com.navita.smartinventory",
"permissionGrants": null,
"workProfileWidgets": null
However these configurationVariables
do not show in the app configured by this policy, RestrictionManager
returns an EmptyBundle
.
So the questions are can RestrictionManager
read these ConfigurationVariables
? And in order to receive values from AMAPI into the app, does the managedConfig iFrame need to be set up?
Am i forced into using a Managed Configuration Provider application for this?
Finally, is this the best way to exchange data from the policies to the application without the use of an managed configuration provider application?
The device this was tested on was provisioned as fully managed and had all the policies from the EMM enforced.
As a general rule of thumbs, managed configurations are intended for parameters that you want to configure in your application (a proxy URL or enabling / disabling part of it). You can use it to send information to an application but it may not be the best option in terms of latency or error handling.
Also, keep in mind that you can use TestDPC to test your apps managed configuration locally on a device just to sort out any Android-side issue.
I'll try to answer your questions:
can RestrictionManager
read these ConfigurationVariables
?
It think that you need to use the ManagedConfiguration
field passing a JSON file that matches what you have in your restrictions.xml
file. Something like:
{
"managedProperty": [
{
"key": "test",
"valueString": "This is a test value"
}
],
"minimumVersionCode": null,
"packageName": "com.navita.smartinventory",
"permissionGrants": null,
"workProfileWidgets": null
}
in order to receive values from AMAPI into the app, does the managedConfig iFrame need to be set up?
You need to have a way to send the managed configuration through AMAPI. the iframe is one option, you can also use an EMM or directly AMAPI. Just be sure to evaluate AMAPI's ToS.
am I forced into using a Managed Configuration Provider application for this?
If with Managed Configuration Provider application you mean an EMM, that's the normal use case for managed configurations.
is this the best way to exchange data from the policies to the application without the use of a managed configuration provider application?
It really depends on your use case. Maybe something like Firebase Remote Config is a better fit for what you want to achieve.