PARqore Native Calls Plugin for NativePHP Mobile#
Your app's calls, on the phone's real call screen.#
Building a calling app with WebRTC, LiveKit, Agora or Twilio? This plugin makes those calls look and behave like phone calls. Incoming calls ring on the iPhone's full-screen CallKit screen, even when your app is closed (via VoIP push, iOS only). Outgoing calls show in the phone's recents. Mute, hold and "another call came in" go through the system, so they behave the way users expect. On Android it uses the system Telecom framework with a proper incoming-call notification (Answer / Decline).
It doesn't carry audio or video. Your calling SDK does that. This plugin handles the call screen and the events your SDK needs.
✅ Device tested (2026-10-11) on a Galaxy A54 and an iPad Air: incoming calls (ring, answer, decline, hang up), outgoing calls (connect, mute, hold, end), the plugin's in-call screen (timer, Mute, End), answering on a locked A54 without the PIN, the ongoing-call notification's Hang up, and the ring timeout with a missed call. On the iPad, a VoIP push rings the app while it is closed, and a missed call shows a "Missed call" notification, both with the app in the background and in front (2026-10-12).
Requirements#
iOS 18.0 or newer, Android 9 (API 28) or newer, PHP 8.2+ and nativephp/mobile 4.6.1+.
Installation#
composer require partek/native-callsphp artisan native:plugin:register partek/native-calls
Rebuild the native projects afterwards (php artisan native:run android or ios).
- iOS: adds the
voipandaudiobackground modes and a microphone usage string. For VoIP pushes (ringing while the app is closed), turn on push notifications inconfig/nativephp.php(permissions.push_notifications), which adds theaps-environmententitlement, and send pushes with an APNs key (see below). - iOS signing: the plugin also adds the
com.apple.developer.usernotifications.time-sensitiveentitlement, so the "Missed call" notification gets through a Focus and isn't held for a Scheduled Summary. Automatic signing picks it up by itself. If you sign manually or in CI (for example fastlane match), turn on Time Sensitive Notifications for the App ID in your Apple Developer account and regenerate the provisioning profile, or signing fails with an entitlement mismatch. - Android: adds
MANAGE_OWN_CALLS,POST_NOTIFICATIONSandUSE_FULL_SCREEN_INTENT, plus the plugin'sConnectionServiceand a small Answer activity. Android 9 or newer. The microphone permission is your calling SDK's job. - Google Play:
USE_FULL_SCREEN_INTENTneeds a declaration in Play Console (App content → Full-screen intent), and from Android 14 Play only grants it by default to apps whose core feature is calling. Without it, incoming calls still ring, as a heads-up notification instead of full screen. Your app can check this withpermissionStatus()(see Locked Android phones).
Usage#
Incoming calls#
use Native\Mobile\Attributes\On;use PARTek\NativeCalls\Events\CallAnswered;use PARTek\NativeCalls\Events\CallEnded;use PARTek\NativeCalls\Facades\NativeCalls; NativeCalls::requestPermission(); // once, early: notifications for the ringing screen (Android 13+) and missed calls $callId = NativeCalls::reportIncoming('Ana', ['handle' => 'ana', 'video' => true]); #[On(CallAnswered::class)]public function answered(string $callId): void{ $this->sdk->join($callId);} #[On(CallEnded::class)]public function ended(string $callId, string $reason): void{ $this->sdk->leave($callId); // reason: declined, local, remote, unanswered, failed, app_restarted, ...}
Outgoing calls#
$callId = NativeCalls::startOutgoing('ana', ['name' => 'Ana', 'video' => true]); // your SDK reports the other side picked up:NativeCalls::connected($callId); // ...and later hung up:NativeCalls::end($callId, 'remote');
The in-call screen#
Once a call is answered (or an outgoing call starts), the plugin shows its own simple in-call screen: the other person's name, a timer, Mute and End. It closes when the call ends. That matters because the system only shows a full call screen while ringing: on iPad, and for Android's self-managed calls, there's no system screen to hang up from once the call is answered.
If your app shows its own call UI (for example a video room), turn it off once, early:
NativeCalls::configure(['callScreen' => false]);
The setting is saved on the device, so it also applies to calls that a VoIP push rings before your app's PHP is running.
While a call is going#
| Event | What to do |
|---|---|
CallAudioActivated |
iOS: start your SDK's audio now (CallKit hands the audio session over) |
CallMuteChanged (muted) |
Mute your SDK's microphone to match |
CallHoldChanged (held) |
Pause / resume your SDK (for example a regular phone call came in) |
CallEnded |
Leave the call |
NativeCalls::activeCalls() lists what the call screen knows about. Check it when your screen opens: a call may have been answered before PHP was running.
If the app's process ends during a call (a crash, or the system stopping the app), the call ends with it. The plugin keeps the ids of live calls on the device, and after the restart it sends CallEnded with reason app_restarted for each call that's gone. That event arrives the first time your app calls the plugin after the restart (for example activeCalls() when your screen opens), because PHP isn't running before that.
Locked Android phones (full-screen intent)#
On Android 14 and newer the ringing screen over the lock screen needs the full-screen intent permission (USE_FULL_SCREEN_INTENT). Google Play grants it by default only to calling apps, and the user can turn it off. Without it a locked phone shows only a small "Incoming call" card. Check it and send the user to the setting:
$status = NativeCalls::permissionStatus(); // doesn't ask the user anything if (! $status->fullScreenIntent) { // Explain first ("so calls ring full screen on a locked phone"), then: NativeCalls::openFullScreenIntentSettings();}
openFullScreenIntentSettings() opens Android's Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT page for your app (the app's own settings page if the phone has no such page). fullScreenIntent is always true on iOS and below Android 14, where there's no such permission, and openFullScreenIntentSettings() returns false there.
Ringing while the app is closed (iOS, VoIP push)#
- Send
NativeCalls::voipToken()(also delivered asVoipTokenUpdated) to your server. It's a PushKit token, not the normal APNs token. - Your server sends an APNs push with
apns-push-type: voipand topic<your bundle id>.voip:
{ "callId": "6f1c2e9a-0d4b-4c6e-9a51-3b7d2f0c8e11", "callerName": "Ana", "handle": "ana", "video": false, "room": "r-42" }
The plugin reports the call to CallKit inside the push handler, as Apple requires (apps that don't are cut off from VoIP pushes). Keys can also sit under "call": {...}. Extra keys (like room) come back in IncomingCallReported::$payload and in activeCalls() (Call::$payload), so your app knows which room to join even when it opened after the call was answered.
Always send callId, and keep it on your server: it's how your server later ends or cancels that call (for example when the caller hangs up first). Without it the plugin makes one up that your server never learns.
Methods#
| Method | Returns | Notes |
|---|---|---|
reportIncoming(string $callerName, array $options = []) |
call id (UUID) | Options: callId, handle, handleType (generic/phone/email), video. Throws NativeCallsException (SYSTEM_REJECTED, NOTIFICATIONS_DISABLED, NOT_SUPPORTED) |
startOutgoing(string $handle, array $options = []) |
call id | Options: callId, name, handleType, video |
connected(string $callId) |
bool | The other side picked up |
end(string $callId, string $reason = 'local') |
bool | local, remote, unanswered, failed, answered_elsewhere, declined_elsewhere |
setMuted(string $callId, bool $muted = true) |
bool | |
setHeld(string $callId, bool $held = true) |
bool | |
activeCalls() |
list<Call> |
callId, direction, state (ringing, dialing, connecting, active, held, ended), callerName, handle, video, muted |
voipToken() |
?string |
iOS only |
configure(array $settings) |
bool | callScreen (default true): show the plugin's in-call screen. ringTimeout (seconds, default 45, 0 = never): an unanswered incoming call ends with CallEnded reason unanswered (a "Missed call" notification on both platforms when notifications are allowed; iPhone also lists it in the Phone app's Recents) |
requestPermission() |
bool | Notification permission (shows the system prompt if the user hasn't been asked). Android 13+ needs it for the ringing screen; iOS uses it for the "Missed call" notification (iPad has no Phone app to show missed calls). Returns whether it's already granted |
permissionStatus() |
PermissionStatus |
Without asking: notifications (bool) and fullScreenIntent (bool; Android 14+, false means a locked phone shows only a small card; always true on iOS and below Android 14) |
openFullScreenIntentSettings() |
bool | Android 14+: opens the page where the user allows full-screen notifications for your app. False on iOS and below Android 14 |
Call ids are UUIDs (CallKit's rule). Pass your own with callId to match your server's call id.
Events#
| Event | Properties |
|---|---|
IncomingCallReported |
callId, callerName, handle, video, fromPush, payload, platform |
CallAnswered |
callId, platform |
CallEnded |
callId, reason, platform. reason: declined, local, unanswered (ring timeout), app_restarted (the app's process ended mid-call; sent after the restart, see above), or what you passed to end(). On iOS, when the system refuses to ring an incoming call, reason is do_not_disturb, blocked, duplicate or failed (and reportIncoming() also throws SYSTEM_REJECTED, so handle it in one place). |
CallMuteChanged |
callId, muted, platform. Sent once per real change |
CallHoldChanged |
callId, held, platform. Sent once per real change |
CallAudioActivated |
callId, platform |
VoipTokenUpdated |
token, platform |
Platform notes#
iOS#
- CallKit is not available to apps on the China App Store; Apple rejects apps that use it there.
- One call at a time (
maximumCallGroups = 1). Calls appear in the Phone app's recents. - The plugin adds the
voipandaudiobackground modes.audiokeeps the call's audio running when the user leaves the app; mention calling in your App Review notes. - A VoIP push must always lead to a reported call. Use regular pushes for anything else.
- With the app in front, iOS only shows a notification if the app's
UNUserNotificationCenterdelegate asks for it. If your app has no delegate, the plugin sets a small one that shows only its own missed-call banner. If your app sets its own delegate (Firebase Messaging or another push plugin, for example), that delegate decides: return.bannerfromwillPresentfor notification ids starting withpartek-missed-to show the banner. The missed call reaches Notification Center either way.
Android#
- A self-managed
ConnectionService: the system knows about the call (audio focus, Bluetooth, other calls put yours on hold), and your app draws the in-call screen. The ringing screen is a CallStyle notification that rings until the call is answered, declined or the ring timeout ends it. Answer opens the app. On a locked phone the call rings on the plugin's own ringing screen over the lock screen, and Answer / Decline work there without the PIN (the phone stays locked; End is on the same screen). That screen needs the full-screen intent permission, which Google Play grants to calling apps that declare it (see above); without it, the call shows as a lock-screen notification, and some phones (Samsung) ask for the PIN before Answer runs. Decline ends the call. While a call is live, an ongoing-call notification with Hang up stays in the shade. - The plugin rings on Android while your app is running or in the background. Ringing a closed app on Android needs a push service that starts native code, which this version doesn't include.
Testing#
Native::fakeBridge()->withNativeCalls(); Native::test(CallScreen::class) ->tap('Call Ana') ->assertOutgoingCallStarted('ana', video: true) ->toggleCallMute(true) ->hangUpCall('remote') ->assertSee('Call ended');
| Helper | Called on | What it does |
|---|---|---|
withNativeCalls(array $active = [], ?string $voipToken = null) |
bridge | Every call succeeds; scripts activeCalls() / voipToken() |
withCallPermissions(bool $notifications = true, bool $fullScreenIntent = true) |
bridge | Scripts requestPermission() / permissionStatus() |
assertIncomingCallReported(?string $callerName = null) |
bridge | |
assertOutgoingCallStarted(?string $handle = null, ?bool $video = null) |
bridge | |
assertCallConnected() / assertCallEnded(?string $reason = null) |
bridge | |
answerCall() / declineCall() |
screen | The user answers / declines the latest call |
hangUpCall(string $reason = 'local') |
screen | Delivers CallEnded |
toggleCallMute(bool) / toggleCallHold(bool) / activateCallAudio() |
screen | |
receiveCallPush(string $callerName, array $payload = []) |
screen | Delivers IncomingCallReported with fromPush |
This package's own suite:
composer installvendor/bin/phpunit
Native checks (no phone needed): tests/android-harness compiles the Kotlin and runs JVM tests of the plugin's call logic (gradle :app:compileDebugKotlin :app:testDebugUnitTest, Gradle 8.14.x), and tests/ios-harness/run.sh compiles the Swift and runs its tests on a booted iOS simulator. See the README in each.
License#
Proprietary commercial software. See LICENSE.