从 cordova 读取 Microsoft Intune 应用配置属性

read Microsoft Intune app configuration properties from cordova

可以使用 Microsoft Intune 应用配置策略将应用配置属性部署到 iOS 应用。这些属性以 plist 格式配置并按照文档中的说明进行部署 https://github.com/MicrosoftDocs/IntuneDocs/blob/master/intune/app-configuration-policies-use-ios.md

Intune iOS SDK 似乎可以将此属性读取为 "MDM app config",如下所述: https://docs.microsoft.com/en-us/intune/app-sdk-ios#enable-targeted-configuration-appmam-app-config-for-your-ios-applications (我无法尝试这个)

Intune 如何部署这些 plist 设置?它会在应用程序私有目录中创建一个 plist 文件吗?如果是,这个文件是怎么命名的?

如果没有,我如何在没有 intune sdk 的情况下从 cordova 访问此属性?我无法在 SDK 源代码中找到有关如何存储/接收它们的任何提示。

NSUserDefaults 是正确的存储,通过使用 cordova-plugin-emm-app-config 插件,我发现来自 MDM 服务器的值存储在 NSUserDefaults 中的 com.apple.configuration.managed 字典键中。

因此,像这样读取 MDM 应用程序配置对 Intune 工作正常:

NSDictionary *appConfig = [[NSUserDefaults standardUserDefaults] dictionaryForKey:kConfigurationKey];