Android セットアップ
このプラグインのインストール手順と全マークダウンガイドを含む設定の質問をコピーします。
1. Intune Gradle プラグインを追加する
「1. Intune Gradle プラグインを追加する」タイトルのセクションアプリ プロジェクトのトップ レベルで、Intune Gradle プラグイン JAR をクラス パスに追加してください。 android/build.gradleプラグイン パッケージには、以下のものが含まれます。 buildscript また、Ionic が現在の Intune Android __CAPGO_KEEP_0__ リリース用に記載している Duo Maven フィードも含めてください。
android/ms-intune-app-sdk-android/GradlePlugin/com.microsoft.intune.mam.build.jar
Also include the Duo Maven feed that Ionic documents for current Intune Android SDK releases:
maven { url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1' name 'Duo-SDK-Feed'}Copy to clipboard
Section titled “2. アプリモジュールを更新”In android/app/build.gradle:
apply plugin: 'com.microsoft.intune.mam'And keep resource optimization disabled:
android.enableResourceOptimizations=false3. 以下のファイルを提供 auth_config.json
Section titled “3. auth_config.jsonを提供”Create android/app/src/main/res/raw/auth_config.json:
{ "client_id": "YOUR_CLIENT_ID", "authorization_user_agent": "BROWSER", "redirect_uri": "msauth://YOUR_PACKAGE/YOUR_SIGNATURE_HASH", "broker_redirect_uri_registered": true, "account_mode": "MULTIPLE", "authorities": [ { "type": "AAD", "audience": { "type": "AzureADMyOrg" } } ]}The plugin expects that file at runtime for both MSAL and the Intune auth callback.
4. 設定 <application> tag
セクションのタイトル “4. アプリケーションタグを設定”アプリが既定のカスタムを定義していない場合 Applicationset:
<application android:name="app.capgo.intune.IntuneApplication" android:enableOnBackInvokedCallback="false">アプリが既定のカスタムを定義している場合 Applicationextend MAMApplication と IntuneMamServiceAuthenticationCallback 5. ブローカーアUTHクエリとリダイレクトハンドリング onMAMCreate().
セクションのタイトル “5. ブローカーアUTHクエリとリダイレクトハンドリング”
パッケージ可視性クエリを追加する:Ionicドキュメントのブラウザ検出の意図
com.azure.authenticatorcom.microsoft.windowsintune.companyportal- 5. ブローカーアUTHクエリとリダイレクトハンドリング
また追加 BrowserTabActivity あなたの msauth:// リダイレクト URI のホスト/パスを指定してください。MSAL はサインインのラウンドトリップを完了できます。
6. プラグインを使用する
「6. プラグインを使用する」のセクションアプリレベルネイティブのセットアップが完了したら、Capacitor API はiOSと同じです。
import { IntuneMAM } from '@capgo/capacitor-intune';
const auth = await IntuneMAM.acquireToken({ scopes: ['https://graph.microsoft.com/.default'],});
await IntuneMAM.registerAndEnrollAccount({ accountId: auth.accountId,});Androidのセットアップから続けてください
セクション「Androidのセットアップから続けてください」Capacitorを使用している場合 Androidのセットアップ ネイティブプラグインの作業を計画する場合、Capacitorを接続してください Using @capgo/capacitor-intune for the native capability in Using @capgo/capacitor-intune Capgo Plugin Directory for the product workflow in Capgo Plugin Directory Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives