Getting Started
复制一个包含安装步骤和此插件的完整Markdown指南的设置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intune`, `@capgo/capacitor-persona`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/persona/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
标题为“安装”您可以使用我们的 AI 助手来安装插件。将以下技能添加到您的 AI 工具中:Capgo
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.如果您更喜欢手动设置,请运行以下命令安装插件并按照以下平台特定的说明进行操作:
bun add @capgo/capacitor-intunebunx cap sync导入
标题为“导入”import { IntuneMAM } from '@capgo/capacitor-intune';API概述
标题为“API概述”acquireToken
标题为“获取令牌”呈现Microsoft登录流程并返回访问令牌和帐户元数据。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireToken({} as AcquireTokenOptions);acquireTokenSilent
Section titled “acquireTokenSilent”从 MSAL 缓存中获取之前登录的用户的令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireTokenSilent({} as AcquireTokenSilentOptions);registerAndEnrollAccount
Section titled “registerAndEnrollAccount”将之前已验证的帐户注册到 Intune 并开始注册。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({} as RegisterAndEnrollAccountOptions);loginAndEnrollAccount
Section titled “loginAndEnrollAccount”要求 Intune 对用户进行身份验证和注册,而不先请求应用程序令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
Section titled “enrolledAccount”返回当前已注册的 Intune 帐户,如果有的话。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.enrolledAccount();deRegisterAndUnenrollAccount
Section titled “注销和解除注册账户”从 Intune 注销账户并在适用时触发选择性擦除。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({} as IntuneMAMUser);logoutOfAccount
Section titled “注销账户”在不解除 Intune 账户的情况下,使用 MSAL 注销用户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({} as IntuneMAMUser);appConfig
Section titled “应用配置”获取远程 Intune 应用配置以管理账户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.appConfig({} as IntuneMAMUser);getPolicy
Section titled “获取策略”获取当前有效的 Intune 应用保护策略以管理账户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.getPolicy({} as IntuneMAMUser);groupName
组名帮助函数,用于解析 GroupName 当应用配置值存在时,获取应用配置值。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.groupName({} as IntuneMAMUser);sdkVersion
组名返回本插件中捆绑的原生 Intune 和 MSAL SDK 版本。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.sdkVersion();displayDiagnosticConsole
组名显示原生 Intune 诊断 UI。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();类型参考
组名AcquireTokenOptions
AcquireTokenOptions标题交互式令牌获取选项。
export interface AcquireTokenOptions { /** * Scopes to request, for example `https://graph.microsoft.com/.default`. */ scopes: string[];
/** * When true, always show the Microsoft account picker or sign-in UI. * * @default false */ forcePrompt?: boolean;
/** * Optional login hint for the interactive sign-in flow. */ loginHint?: string;}IntuneMAMAcquireToken
IntuneMAMAcquireToken标题export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}AcquireTokenSilentOptions
AcquireTokenSilentOptions标题静默令牌获取选项。
export interface AcquireTokenSilentOptions { /** * Scopes to request, for example `https://graph.microsoft.com/.default`. */ scopes: string[];
/** * Microsoft Entra object ID returned by `acquireToken` or `enrolledAccount`. */ accountId: string;
/** * When true, bypass the cached access token and request a fresh one. * * @default false */ forceRefresh?: boolean;}RegisterAndEnrollAccountOptions
RegisterAndEnrollAccountOptions标题export interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
IntuneMAMUser标题export interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
IntuneMAMAppConfig标题export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
IntuneMAMPolicy标题export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
IntuneMAMGroupName标题export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
IntuneMAMVersionInfo标题export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
IntuneMAMChangeEvent标题export interface IntuneMAMChangeEvent { accountId?: string;}真实数据来源
真实数据来源标题本页面由插件生成 src/definitions.ts. 当上游的公共 API 变更时,请重新同步
继续从 Getting Started
标题为“继续从 Getting Started”如果您正在使用 Getting Started 来规划仪表板和 API 操作,请将其连接到 使用 @capgo/capacitor-intune 用于在使用 @capgo/capacitor-intune 中的本机功能 API Overview 用于在 API Overview 中的实现细节 介绍 在介绍中实现细节 API 键 在 API 键中实现细节 设备 在设备中实现细节