From 632424551fcdcaea387a19e00a07c8e0ea3c14dc Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Sat, 28 Nov 2026 10:55:28 +0000 Subject: [PATCH] Add over-the-air updates in silent mode This adds nativephp/mobile-ota 1.0.2 and turns on its silent mode. The app checks for an update once per launch, in the background, downloads it if there is one, and applies it the next time it starts. Nothing is shown on screen and the launch never waits for it. config/nativephp-ota.php only sets the mode, so a store build doesn't rely on NATIVEPHP_OTA_MODE being set in Bifrost. The plugin's own config fills in the rest from what Bifrost writes into the build. The provider is added to plugins() by hand, because native:plugin:register can't edit that method with the conditional social auth spread in it. Co-Authored-By: Claude Opus 5.5 --- app/Providers/NativeServiceProvider.php | 2 + composer.json | 1 + composer.lock | 58 ++++++++++++++++++++++++- config/nativephp-ota.php | 22 ++++++++++ tests/Feature/OtaTest.php | 9 ++++ 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 config/nativephp-ota.php create mode 100644 tests/Feature/OtaTest.php diff --git a/app/Providers/NativeServiceProvider.php b/app/Providers/NativeServiceProvider.php index d480e814..5c187070 100644 --- a/app/Providers/NativeServiceProvider.php +++ b/app/Providers/NativeServiceProvider.php @@ -17,6 +17,7 @@ use Native\Mobile\UI\NativeUIServiceProvider; use NativePHP\Clipboard\ClipboardServiceProvider; use NativePHP\MediaPlayer\MediaPlayerServiceProvider; +use Nativephp\MobileOta\OtaServiceProvider; use S2BR\MobileSplashscreen\MobileSplashscreenServiceProvider; use Victorycodedev\ToastKit\ToastKitServiceProvider; @@ -68,6 +69,7 @@ public function plugins(): array CallsServiceProvider::class, PhotosServiceProvider::class, SkiaServiceProvider::class, + OtaServiceProvider::class, ...(config('devnull.apple_sign_in') ? [NativephpSocialAuthServiceProvider::class] : []), ]; } diff --git a/composer.json b/composer.json index 2f15afd8..0664efc1 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,7 @@ "nativephp/mobile-firebase": "^1.1", "nativephp/mobile-media-player": "^1.1", "nativephp/mobile-microphone": "^1.2", + "nativephp/mobile-ota": "^1.0.2", "nativephp/mobile-secure-storage": "^1.1", "nativephp/mobile-share": "^1.1", "nativephp/mobile-skia": "^1.0", diff --git a/composer.lock b/composer.lock index dc1a40e7..233baabc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eca2b9e1fd10e2200de3f982c65992d3", + "content-hash": "9891cbca9bc7dc4cfc23eca296f9195a", "packages": [ { "name": "bacon/bacon-qr-code", @@ -3300,6 +3300,62 @@ "time": "2026-10-29T09:22:03+00:00", "published-time": "2026-10-29T09:22:40+00:00" }, + { + "name": "nativephp/mobile-ota", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/NativePHP/mobile-ota.git", + "reference": "fbb3fd9e78d376219e6d61cf2db28f05ffcc7080" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/NativePHP/mobile-ota/zipball/fbb3fd9e78d376219e6d61cf2db28f05ffcc7080", + "reference": "fbb3fd9e78d376219e6d61cf2db28f05ffcc7080", + "shasum": "" + }, + "require": { + "nativephp/mobile": "^3.3.11 || ^4.6.1", + "php": "^8.2" + }, + "require-dev": { + "orchestra/testbench": "^10.0", + "pestphp/pest": "^2.7|^3.0|^4.0" + }, + "type": "nativephp-plugin", + "extra": { + "laravel": { + "providers": [ + "Nativephp\\MobileOta\\OtaServiceProvider" + ] + }, + "nativephp": { + "manifest": "nativephp.json" + } + }, + "autoload": { + "psr-4": { + "Nativephp\\MobileOta\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bifrost Technology, LLC", + "email": "support@nativephp.com" + } + ], + "description": "Over-the-air PHP payload updates for NativePHP Mobile", + "support": { + "issues": "https://github.com/NativePHP/mobile-ota/issues", + "source": "https://github.com/NativePHP/mobile-ota/tree/1.0.2" + }, + "time": "2026-11-28T10:50:18+00:00", + "published-time": "2026-11-28T10:50:31+00:00" + }, { "name": "nativephp/mobile-secure-storage", "version": "1.1.0", diff --git a/config/nativephp-ota.php b/config/nativephp-ota.php new file mode 100644 index 00000000..3b7fd0c1 --- /dev/null +++ b/config/nativephp-ota.php @@ -0,0 +1,22 @@ + env('NATIVEPHP_OTA_MODE', 'silent'), + +]; diff --git a/tests/Feature/OtaTest.php b/tests/Feature/OtaTest.php new file mode 100644 index 00000000..080137d1 --- /dev/null +++ b/tests/Feature/OtaTest.php @@ -0,0 +1,9 @@ +plugins())->toContain(OtaServiceProvider::class) + ->and(config('nativephp-ota.mode'))->toBe('silent'); +});