feat(managed-config): Add Managed Config plugin (@config-plugins/mana… #228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
The motivation behind this PR is to provide Expo developers with a way to configure their apps for Mobile Device Management (MDM) solutions. Managed are used in apps deployed in enterprise environments, allowing IT administrators to remotely manage and configure settings within an app for users within their organization. It can be complimented with
react-native-emm
orreact-native-mdm
to integrate MDM features.This PR introduces the @config-plugins/managed-config to @expo/config-plugins to allow MDM configuration support without being tied to a specific library.
Relevant issues and requests:
How
The
@config-plugins/managed-config
plugin was developed following the Expo Config Plugin system's guidelines, leveraging the Android Managed Configurations XML resource file to declare app restrictions. It parses a given set of restrictions defined in theapp.json
orapp.config.js
under the plugin options and generates the corresponding XML file at build time, which is then included in the final Android app bundle.The plugin supports all documented restriction types (e.g.,
bool
,string
,integer
,choice
,multi-select
,hidden
,bundle
, andbundle_array
).Test Plan
The plugin has been thoroughly tested with a series of unit tests covering each restriction type (
bool
,string
,integer
,choice
,multi-select
,hidden
,bundle
,bundle_array
). These tests validate the XML generation logic, ensuring that the output matches the expected configuration for a given set of restrictions.Additional manual testing was performed using the
apps/app
project and validating that theapp_restrictions
file was added, and the android manifest was modified correctly.