Search by

zinxan / native-mobile

Matildeene

Error tracking for NativePHP iOS and Android apps, reported to NativeWatch.

Package info

github.com/zinxan/native.mobile

Homepage

Documentation

Type:nativephp-plugin

pkg:composer/zinxan/native-mobile

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-11-01 16:35 UTC

This package is auto-updated.

Last update: 2026-11-01 16:48:09 UTC


README

Contributing

Error tracking for NativePHP iOS and Android apps. Errors go to NativeWatch.

composer require zinxan/native-mobile

Add the key of your NativeWatch project to .env:

NATIVEWATCH_KEY=nw_...
NATIVEWATCH_URL=https://native.watch

Register the plugin, so its Swift and Kotlin crash reporter is compiled into your app:

php artisan vendor:publish --tag=nativephp-plugins-provider
php artisan native:plugin:register zinxan/native-mobile

Native reporting starts only after explicit opt-in in the updated plugin. Read the privacy guide and runnable consent example before shipping, and rebuild the native app after upgrading. Use NativeWatch::setConsent(true) only after the user's affirmative choice; NativeWatch::setConsent(false) withdraws it and clears pending SDK reports. See the installation verification steps for actual errors and device tests.

Native crashes (Objective-C and Swift on iOS, uncaught exceptions, ANRs and NDK crashes on Android) are stored on the device and sent the next time the app opens.

For iOS function/file/line resolution, archive the exact Release dSYMs and upload them from CI with php artisan nativewatch:symbols. Follow the complete symbolication guide for build settings, CI secrets, worker tools and verification. Diagnostic consent still controls crash capture and delivery; a CI upload token must never ship in the app.

Send a test error:

php artisan nativewatch:test

After consent, reportable exceptions enter a bounded device outbox and normally send after responses. Failed network delivery can retry later. Capture and disk work still have a cost; an unwritable outbox can cause an immediate send attempt.

Report something yourself:

use ZXN\NativeWatch\Core\Laravel\NativeWatch;
use ZXN\NativeWatch\Core\Level;

NativeWatch::addBreadcrumb('sync', 'Started the sync');
NativeWatch::captureMessage('The disk is almost full', Level::Warning);
NativeWatch::captureException($exception);

Publish the config to change sampling, scrubbing or breadcrumbs:

php artisan vendor:publish --tag=nativewatch-config