メニューに進む

Android

Androidの動作のしくみ

「Androidの動作のしくみ」

Androidの場合、プラグインは高優先順位の着信通知を投稿し、プラットフォームとユーザー設定が許可する場合、フルスクリーンアクティビティを上げることができます。

プラグインマニフェストには、以下が含まれています:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />

インストール後、 cap sync ホストアプリにその設定をマージするだけです。

実行時許可

「実行時許可」

着信表示を利用する前に、またはオンボーディング中に、次のメソッドを呼びます:

import { IncomingCallKit } from '@capgo/capacitor-incoming-call-kit';
await IncomingCallKit.requestPermissions();
await IncomingCallKit.requestFullScreenIntentPermission();
  • requestPermissions() Android 13以降では、通知許可を要求します。
  • requestFullScreenIntentPermission() Android 14 以降のフルスクリーン インテントの設定画面を開きます。
import { IncomingCallKit } from '@capgo/capacitor-incoming-call-kit';
await IncomingCallKit.showIncomingCall({
callId: 'call-42',
callerName: 'Ada Lovelace',
appName: 'Capgo Phone',
timeoutMs: 45_000,
android: {
channelId: 'calls',
channelName: 'Incoming Calls',
showFullScreen: true,
isHighPriority: true,
accentColor: '#0F766E',
},
});
  • channelId__CAPGO_KEEP_0__
  • channelName__CAPGO_KEEP_1__
  • showFullScreen__CAPGO_KEEP_2__
  • isHighPriority__CAPGO_KEEP_3__
  • accentColor__CAPGO_KEEP_4__
  • ringtoneUri__CAPGO_KEEP_5__
  • フルスクリーン表示はベストエフォートです。デバイスまたはユーザー設定がブロックした場合、Androidは着信通知を表示します。
  • タイムアウトの処理はベストエフォートです。プラグインは timeoutMs と追跡 callTimedOut,
  • Accept, decline, and end actions are emitted back through Capacitor listeners so your app can join or clean up the real call session.
推奨の生産モデル

Use Android push or your calling SDK for transport, then let this plugin handle the last mile of native ringing UI. Keep these responsibilities outside the plugin:

  • Android Pushまたはコールの__CAPGO_KEEP_0__を使用して輸送を実行し、最後のマイルのネイティブリングUIをこのプラグインで処理してください。このプラグイン外で責任を負うものは次のとおりです:
  • FCMの登録とトークン管理
  • バックエンド呼び出し状態
  • リトライとミスしたコールのビジネスロジック