__CAPGO_KEEP_0__ アプリのリアルタイムの更新管理を行うことができます。

はじめに

  1. パッケージをインストール

    ターミナルウィンドウ
    bun add @capgo/capacitor-intune
  2. ネイティブプロジェクトを同期

    ターミナルウィンドウ
    bunx cap sync
  3. Intuneのネイティブ設定を完了する Cloudflareの「Dedicated iOS setup」と「Dedicated Android setup」のページを参照してください。 iOSの設定Androidの設定 Intuneは、ホストアプリのネイティブ設定、ブローカーアUTH、リダイレクトURI、manifest、エンタイトルメント、MSALの設定が必要です。

  • Capacitor 8+
  • Android with Intune Android SDK 12.0.3
  • iOS with Intune iOS SDK 21.5.1
  • iOSのデプロイメントターゲット 17.0+

Xcode 26を使用して作成したアプリの場合、Intuneのドキュメントは2026年1月19日以降のカットオフを呼び出しています。Intune iOS SDK 21.1.0+このプラグインはすでに 21.5.1.

基本的な使用方法

「基本的な使用方法」
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.addListener('appConfigChange', (result) => {
console.log('App config changed', result.accountId);
});
await IntuneMAM.addListener('policyChange', (result) => {
console.log('Policy changed', result.accountId);
});
const auth = await IntuneMAM.acquireToken({
scopes: ['https://graph.microsoft.com/.default'],
loginHint: 'alex@example.com',
});
await IntuneMAM.registerAndEnrollAccount({
accountId: auth.accountId,
});
const appConfig = await IntuneMAM.appConfig({
accountId: auth.accountId,
});
const policy = await IntuneMAM.getPolicy({
accountId: auth.accountId,
});
console.log({ auth, appConfig, policy });

一般的なフロー

「一般的なフロー」

インタラクティブなサインインとエンロール

「インタラクティブなサインインとエンロール」
const auth = await IntuneMAM.acquireToken({
scopes: ['https://graph.microsoft.com/.default'],
});
await IntuneMAM.registerAndEnrollAccount({
accountId: auth.accountId,
});

静的トークン更新

「静的トークン更新」
const token = await IntuneMAM.acquireTokenSilent({
accountId: 'AAD_OBJECT_ID',
scopes: ['https://graph.microsoft.com/.default'],
forceRefresh: true,
});

現在登録されているアカウントを読み取ります

「現在登録されているアカウントを読み取ります」セクション
const user = await IntuneMAM.enrolledAccount();

サインアウトまたは選択的に消去

「サインアウトまたは選択的に消去」セクション
await IntuneMAM.logoutOfAccount({ accountId: 'AAD_OBJECT_ID' });
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'AAD_OBJECT_ID' });
  • acquireToken(options)Microsoft サインインを開始し、トークンとアカウント メタデータを返します。
  • acquireTokenSilent(options)既存のアカウントのキャッシュされたトークンを読み取ります。
  • registerAndEnrollAccount(options)MSAL アカウントを Intune と連携し、登録をトリガーします。
  • loginAndEnrollAccount(): Intuneでログインとエンロールフローを制御する。
  • appConfig(user): Intuneアプリの設定値をアカウントで読み取ります。
  • getPolicy(user): Intuneアプリ保護ポリシーをアカウントで読み取ります。
  • groupName(user): 共通のconfigヘルパー値を取得します。 GroupName : IntuneとMSALのバンドルバージョンを検査します。
  • sdkVersion()プラットフォームに関する注意

プラットフォームに関する注意

Webはサポートされていません。
  • iOSとAndroidは、Azureの登録、Intuneポリシー割り当て、リダイレクトURI、およびエンタイトメントはアプリ固有です。
  • エディットページ cap sync.
  • Edit page