Download the PHP package stitch-digital/mobile-call-detection without Composer

On this page you can find all versions of the php package stitch-digital/mobile-call-detection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mobile-call-detection

Call Detection Plugin for NativePHP Mobile

A NativePHP Mobile plugin that detects when phone calls end and fires a CallEnded event with call metadata.

Useful for apps that need to log calls, trigger workflows after conversations, or track call activity — such as CRM, sales, or support applications.


Platform Support

Feature Android iOS
Phone number ❌ Not available (Apple privacy)
Call direction inbound / outbound ❌ Always unknown
Duration ✅ From call log (accurate) ⚠️ From timestamps (approximate)
Background detection ✅ BroadcastReceiver ⚠️ Limited (CXCallObserver)
Permissions required ✅ None needed

How It Works

Android uses a manifest-registered BroadcastReceiver that listens for android.intent.action.PHONE_STATE. A state machine tracks transitions between RINGING, OFFHOOK, and IDLE to determine when a call ends and whether it was inbound or outbound. After the call ends, the plugin waits ~1 second then queries CallLog.Calls.CONTENT_URI for the phone number, direction, and duration.

iOS uses CXCallObserver with a CXCallObserverDelegate. Apple privacy restrictions mean the plugin cannot access the phone number or call direction. It tracks hasConnected timestamps per call UUID to approximate duration, and dispatches the event when hasEnded becomes true.


Requirements

Minimum
PHP 8.2
NativePHP Mobile 3.x
Android API 21+
iOS 13.0+

Installation

The service provider and CallDetection facade are auto-discovered by Laravel — no manual registration needed.


Quick Start

Then listen for the CallEnded event in your Livewire component or event listener.


PHP API

All methods are available via the CallDetection facade or by resolving StitchDigital\CallDetection\CallDetection from the container.

hasPermission(): bool

Check whether the required permissions have been granted.

Returns false if running outside NativePHP.


requestPermission(): bool

Request call detection permissions from the user.

Returns false if running outside NativePHP.


JavaScript API


Events

The plugin dispatches a single event that covers the full call lifecycle completion.

Event Dispatched when
CallEnded A phone call has finished

CallEnded Payload

Property Type Description
$phoneNumber ?string The phone number (null on iOS)
$direction string 'inbound', 'outbound', or 'unknown'
$duration int Call duration in seconds
$platform string 'android' or 'ios'

Listening with #[OnNative]

Vue Example

React Example


Platform Notes

Android

iOS


Testing

Then trigger the permission flow and make a test call:

Android — call CallDetection::requestPermission(), grant both permissions, then make or receive a phone call. The CallEnded event should fire with the phone number, direction, and duration.

iOS — make or receive a phone call. The CallEnded event should fire with null phoneNumber, "unknown" direction, and an approximate duration.


License

The MIT License (MIT). Please see License File for more information.


All versions of mobile-call-detection with dependencies

PHP Build Version
Package Version
Requires nativephp/mobile Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stitch-digital/mobile-call-detection contains the following files

Loading the files please wait ...