メインコンテンツにジャンプ

Android セットアップ

GitHub

1. Intune Gradle プラグインを追加する

セクション「1. Intune Gradle プラグインを追加する」

アプリのプロジェクトのトップレベル android/build.gradleに、Intune Gradle プラグイン JAR をクラスパスに追加します。プラグイン パッケージには、以下のものが含まれます。 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'
}

セクション「2. アプリ モジュールを更新する」

アプリ

コピー android/app/build.gradle:

apply plugin: 'com.microsoft.intune.mam'

セクション「2. アプリ モジュールを更新する」

android.enableResourceOptimizations=false

作成 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"
}
}
]
}

プラグインは、MSALとIntuneの認証コールバックの両方で、実行時にはそのファイルを期待しています。

アプリが既にカスタムを定義していない場合、 Applicationset:

<application
android:name="app.capgo.intune.IntuneApplication"
android:enableOnBackInvokedCallback="false">

If you already have a custom __CAPGO_KEEP_0__ Application, __CAPGO_KEEP_1__ MAMApplication と登録 IntuneMamServiceAuthenticationCallback in __CAPGO_KEEP_2__ onMAMCreate().

5. Broker認証クエリとリダイレクトハンドリングを追加

セクション:5. Broker認証クエリとリダイレクトハンドリング

パッケージの可視性クエリを追加:Ionicドキュメント

  • com.azure.authenticator
  • com.microsoft.windowsintune.companyportal
  • ブラウザ検出の意図

また、 BrowserTabActivity あなたの msauth:// リダイレクトURIホスト/パスをMSALにサインインのラウンドトリップを完了させるように設定

iOSの設定が完了した後、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のセットアップから続ける

Section titled “Androidのセットアップから続ける”

Capacitorを使用している場合 Androidのセットアップ Capacitorを使用してネイティブプラグインの作業を計画するには、__CAPGO_KEEP_0__-intuneと接続します。 @capgo/capacitor-intuneを使用してネイティブ機能を使用する場合 for the native capability in Using @capgo/capacitor-intune, Capgo プラグインディレクトリを使用して製品ワークフローを使用する場合 for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, __CAPGO_KEEP_0__ プラグイン __CAPGO_KEEP_1__ によって プラグインの追加または更新 プラグインの追加または更新の実装詳細については、