Démarrage
Copier un prompt de configuration avec les étapes d'installation et le guide Markdown complet pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-incoming-call-kit`
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/incoming-call-kit/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.
-
Installez le package
Fenêtre de terminal bun add @capgo/capacitor-incoming-call-kit -
Synchroniser les projets natifs
Fenêtre de terminal bunx cap sync -
Choisissez votre source de sonnerie Décidez si l'événement de la sonnerie entrante provient de votre backend, d'un SDK tel que Twilio ou Stream, ou d'une voie de sonnerie native comme FCM ou PushKit.
Comment l'intégration s'assemble
Section intitulée “Comment l'intégration s'assemble”Ce plugin n'assume que la présentation de la sonnerie entrante native. Votre application conserve toujours la gestion du transport, de l'authentification et de la session de médias réelle.
Le modèle de production courant est :
- Votre backend ou votre SDK d'appel émet un événement de sonnerie.
- Votre application appelle
showIncomingCall(). - Le plugin présente une interface utilisateur de sonnerie entrante native.
callAcceptedoucallDeclined,callEndedoucallTimedOutou
Intégration minimale
Section intitulée “Intégration minimale”import { IncomingCallKit } from '@capgo/capacitor-incoming-call-kit';
await IncomingCallKit.requestPermissions();await IncomingCallKit.requestFullScreenIntentPermission();
await IncomingCallKit.addListener('callAccepted', async ({ call }) => { console.log('Accepted', call.callId, call.extra); // Start or join your real call session here.});
await IncomingCallKit.addListener('callDeclined', ({ call }) => { console.log('Declined', call.callId); // Tell your backend or SDK that the user declined.});
await IncomingCallKit.addListener('callTimedOut', ({ call }) => { console.log('Timed out', call.callId); // Clear ringing state in your backend or SDK.});
await IncomingCallKit.showIncomingCall({ callId: 'call-42', callerName: 'Ada Lovelace', handle: '+39 555 010 020', appName: 'Capgo Phone', hasVideo: true, timeoutMs: 45_000, extra: { roomId: 'room-42', callerUserId: 'user_ada', }, android: { channelId: 'calls', channelName: 'Incoming Calls', showFullScreen: true, }, ios: { handleType: 'phoneNumber', },});Options importantes
Section intitulée “Options importantes”callId: identifiant stable réutilisé plus tardendCall()timeoutMs: temps d'attente non garantiextra: JSON arbitraire renvoyé dans les payloads des écouteursandroid.channelIdetandroid.channelName: réglage du canal de notification Androidandroid.showFullScreen: demande l'activité d'appel entrant en mode plein écran Androidios.handleTypechoisissezgeneric,phoneNumber, ouemailAddresspour CallKit
Gestion des appels actifs
Section intitulée “Gestion des appels actifs”const { calls } = await IncomingCallKit.getActiveCalls();
await IncomingCallKit.endCall({ callId: 'call-42', reason: 'remote-ended',});
await IncomingCallKit.endAllCalls({ reason: 'session-reset',});Modèle d'événement
Section intitulée “Modèle d'événement”incomingCallDisplayed: l'interface utilisateur native a été affichée avec succèscallAccepted: l'utilisateur a accepté depuis l'interface utilisateur nativecallDeclined: l'utilisateur a refusé avant de rejoindrecallEnded: votre application ou la plateforme a mis fin à l'appel suivicallTimedOut: l'appel est resté sans réponsetimeoutMs
Chaque événement transporte le payload normalisé et votre objet original. call Remarques relatives aux plateformes extra Lisez le guide iOS
Avant de brancher CallKit dans un flux PushKit ou APNs, lisez le guide iOS.
Lisez le guide Android- Avant de vous appuyer sur les intentions d'écran plein sur Android 14 et ultérieur, lisez le guide Android. La version Web n'est pas prise en charge. __CAPGO_KEEP_0__
- __CAPGO_KEEP_0__ __CAPGO_KEEP_0__ __CAPGO_KEEP_0__
- __CAPGO_KEEP_0__