-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(managed-config): Add Managed Config plugin (@config-plugins/mana… #228
base: main
Are you sure you want to change the base?
Conversation
39f0e78
to
8d49fdf
Compare
8d49fdf
to
d3c67df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to compile the module correctly to js, path and fs should be named imports, I think
import fs from "fs"; | ||
import path from "path"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import fs from "fs"; | |
import path from "path"; | |
import * as fs from "fs"; | |
import * as path from "path"; |
import fs from "fs"; | ||
import path from "path"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import fs from "fs"; | |
import path from "path"; | |
import * as fs from "fs"; | |
import * as path from "path"; |
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.