跳转到正文

iOS 配置

GitHub
  • 此插件内置的 Intune iOS SDK: 21.5.1
  • 最低 iOS 版本: 17.0
  • 推荐 Xcode 版本: 26.x

Ionic 的 Intune 文档目前指出,用 Xcode 26 构建的应用必须使用 Intune iOS SDK 21.1.0+ 自 2026 年 1 月 19 日起。本插件已采用这一较新的 SDK 版本线。

1. 将 Intune 和 MSAL 设置添加到 Info.plist

标题为“1. 将 Intune 和 MSAL 设置添加到 Info.plist”的章节

添加一个 IntuneMAMSettings 字典:

<key>IntuneMAMSettings</key>
<dict>
<key>ADALClientId</key>
<string>YOUR_CLIENT_ID</string>
<key>ADALRedirectUri</key>
<string>msauth.com.example.app://auth</string>
<key>ADALAuthority</key>
<string>https://login.microsoftonline.com/common</string>
</dict>

插件读取:

  • ADALClientId
  • ADALRedirectUri
  • ADALRedirectScheme 如果你更愿意只存储 scheme,可作为回退方案
  • ADALAuthority 作为可选的权限覆盖

2. 在 AppDelegate 中转发 MSAL 回调 AppDelegate

标题为“2. 在 AppDelegate 中转发 MSAL 回调”的章节
import MSAL
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return MSALPublicClientApplication.handleMSALResponse(
url,
sourceApplication: options[.sourceApplication] as? String
)
}

请遵循 Microsoft 和 Ionic 的 Intune 指南,配置以下内容:

  • 这个 msauth... 重定向 URI scheme
  • 钥匙串共享 / 钥匙串访问组
  • LSApplicationQueriesSchemes
  • NSFaceIDUsageDescription 如果您的流程需要生物识别

这些是应用特定的,插件无法自动推断。

Microsoft 要求针对最终应用运行 IntuneMAMConfigurator 针对您的最终应用 Info.plist 以及 entitlements。请使用官方 Intune iOS SDK 中的最新配置工具,并在这些文件发生实质性变更时重新运行。

5. 保持部署目标版本一致

标题为“5. 保持部署目标一致”

因为捆绑的 Intune iOS SDK 处于当前 21.x 或更高版本。 17.0 或更高版本。

如果你正在使用 iOS 配置 要规划原生插件工作,请将其与 使用 @capgo/capacitor-intune 用于“使用 @capgo/capacitor-intune”中的原生能力, Capgo 插件目录 查看 Capgo 插件目录中的产品工作流, Capgo 提供的 Capacitor 插件 查看由 Capgo 提供的 Capacitor 插件中的实现细节, 添加或更新插件 关于“添加或更新插件”中的实现细节,以及 Ionic Enterprise 插件替代方案 关于“Ionic Enterprise 插件替代方案”中的产品工作流。