开始使用
复制一个包含安装步骤和本插件的完整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 助手设置来安装插件。将 Capgo 技能添加到您的 AI 工具中,使用以下命令:
bunx 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';快速入门
快速入门import { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});常见问题
常见问题- 监听器: 移除屏幕卸载时的句柄。
- 原生同步: 运行
bunx cap sync升级插件后 - 真实来源: 信任
src/definitions.ts在 GitHub 仓库中
API 概览
标题:API 概览acquireToken
标题:acquireToken呈现 Microsoft 登录流程并返回访问令牌及帐户元数据
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.acquireTokenSilent
获取令牌(acquireTokenSilent)从 MSAL 缓存中获取之前登录的用户的令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireTokenSilent({ scopes: ['openid'], accountId: 'acquireToken',});// The result holds sensitive values: use it without logging it.registerAndEnrollAccount
注册并开始注册登录并开始注册
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });loginAndEnrollAccount
询问 Intune 进行身份验证和注册已注册帐户
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
返回可用的 Intune 帐户注销并取消注册
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
__CAPGO_KEEP_0__Deregister Intune账户并在适用情况下触发选择性清除。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
登出账户注销用户MSAL账户而不解除Intune账户注册
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
应用配置获取远程Intune应用配置
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
获取Intune应用保护策略获取Intune应用保护策略
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
组名称便捷工具,用于解析 GroupName 当存在时,应用配置值
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);返回本地 Intune 和 MSAL SDK 版本,通过此插件打包。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
返回本插件中捆绑的原生Intune和MSAL __CAPGO_KEEP_0__ 版本。标题为“displayDiagnosticConsole”
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();显示原生Intune诊断UI。
类型参考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
Intune MAM 获取令牌export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}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
Intune MAM 用户export interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
Intune MAM 应用配置export interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
复制到剪贴板export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
Intune MAM 政策export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
Intune MAM 组名export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
Intune MAM 版本信息export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
Intune MAM 变更事件export interface IntuneMAMChangeEvent { accountId?: string;}真实来源
真实来源本页面是根据插件生成的 src/definitions.ts重新同步时,公共API发生变化时,请重新运行。
继续从开始
标题:继续从开始如果您正在使用 开始 用于规划仪表板和API操作的 使用@capgo/capacitor-intune 使用@capgo/capacitor-intune 使用@API/__CAPGO_KEEP_1__-intune API概述 __CAPGO_KEEP_0__概述 介绍 API 键 为 API 键的实现细节 设备 为设备的实现细节