【问题标题】:read Microsoft Intune app configuration properties from cordova从 cordova 读取 Microsoft Intune 应用配置属性
【发布时间】:2023-05-23 15:02:01
【问题描述】:

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

Intune iOS SDK 似乎可以将此属性读取为“MDM 应用程序配置”,如下所述: 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-nativestorage 插件) - 但我在此存储中找不到密钥

标签: ios cordova nsuserdefaults mdm intune


【解决方案1】:

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

因此,像这样读取 MDM 应用配置对于 Intune 来说效果很好:

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

【讨论】: