Download the PHP package blutrixx/nativephp-mobile-updater without Composer
On this page you can find all versions of the php package blutrixx/nativephp-mobile-updater. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blutrixx/nativephp-mobile-updater
More information about blutrixx/nativephp-mobile-updater
Files in blutrixx/nativephp-mobile-updater
Package nativephp-mobile-updater
Short Description Self-hosted APK updater plugin for NativePHP Mobile
License MIT
Informations about the package nativephp-mobile-updater
Blutrixx Mobile Updater
A NativePHP Mobile plugin for self-hosted over-the-air APK updates — no Play Store required. It downloads a full APK from a URL you supply, verifies its size/checksum, and hands off to the Android system installer. Your app is responsible for deciding when an update is available (fetching your own update manifest and comparing versions); this package only handles the download/verify/install mechanics.
Composer package: blutrixx/nativephp-mobile-updater
Repo: joelnjoshkibona/nativephp-mobile-updater
Current release: v1.0.0
Requirements
- PHP ^8.1
- A Laravel app running under
nativephp/mobile^3.3 (enforced bycomposer.json; 4.x is not supported yet) - Android: requests
REQUEST_INSTALL_PACKAGES(to launch the system installer) andPOST_NOTIFICATIONS(download progress notification) permissions. - A place to host APKs + an update manifest — see Recommended manifest shape below.
Installation
Not on Packagist yet.
As a git submodule (how this repo itself consumes it):
Without a submodule:
Laravel auto-discovers MobileUpdaterServiceProvider and the MobileUpdater facade alias.
How the bridge works
checkVersion(), cancelDownload(), installApk(), and checkDownloadStatus() are synchronous — they return a real result immediately. download() is asynchronous: it starts a background download and returns right away; progress and completion arrive later as native-core events (Native\Mobile\Events\MobileUpdater\DownloadProgress / DownloadComplete / DownloadFailed) that NativePHP itself dispatches — not classes this package defines, since they're part of NativePHP's own event surface. Listen for them the same way described in blutrixx/nativephp-device-utils' README (matching by .endsWith() on the event name), or poll checkDownloadStatus() if you'd rather not wire up a listener.
API reference
| Method | Sync? | Returns | Notes |
|---|---|---|---|
checkVersion() |
Sync | array |
Reads the currently installed app version from the embedded .env — does not check a remote manifest itself |
download(string $url, ?int $expectedSize = null, ?string $sha256 = null) |
Async | array |
Starts the download; fires DownloadProgress/DownloadComplete/DownloadFailed |
cancelDownload() |
Sync | array |
Cancels an in-progress download; the partial file is kept so a later download() call to the same URL can resume |
installApk() |
Sync | array |
Launches the Android system package installer for the already-downloaded APK |
checkDownloadStatus() |
Sync | {ready: bool, size: int, inProgress: bool} |
Check whether an APK is already downloaded and ready to install, without starting a new download |
Recommended manifest shape
This package doesn't fetch or parse a remote manifest for you — your app hits its own update-check endpoint (however you host it) and decides what to pass to download(). A shape that works well in practice, one entry per architecture/variant:
Compare latestVersion against MobileUpdater::checkVersion()'s result client-side (or server-side, in the controller that serves your update-check route), and only call download() if there's actually a newer version — the mandatory flag is a convention for your own UI to decide whether the update screen is skippable, not something this package enforces.