Download the PHP package nativephp/mobile-ota without Composer

On this page you can find all versions of the php package nativephp/mobile-ota. 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-ota

NativePHP Mobile OTA

Over-the-air updates for NativePHP Mobile apps. Send a new version of your app's PHP code, views and assets straight to the phones it's installed on, without a store review.

This plugin is the part that runs in your app. It checks for an update, downloads it, and hands it to NativePHP to apply the next time the app starts. Updates are built and published by Bifrost. See OTA Updates in the Bifrost docs for sending them.

The plugin is free.

What an update can change

An OTA update replaces your Laravel app: routes, controllers, Livewire components, Blade views, CSS, JavaScript and images.

It can't change what's compiled into the app. Adding or updating a NativePHP plugin, updating nativephp/mobile, or changing native settings in config/nativephp.php (app ID, permissions, deep links and so on) still needs a new store build.

Requirements

Installation

Then ship a new store build from Bifrost. Bifrost writes everything the app needs to find its updates into the build: the project, the Arc it was built on, and a fingerprint of its native setup. You don't need to set any of it yourself.

An app only receives updates published to its own Arc, for the same native setup it was built with. A Staging build gets Staging updates, and a Production build gets Production updates.

Choosing when to update

Set NATIVEPHP_OTA_MODE in your .env:

Mode What happens
manual (default) Nothing happens on its own. Your app decides when to check, using the methods below.
prompt Once per launch, the app checks for an update in the background and, once it's on screen, asks Later or Update. Update downloads it behind a progress screen, then tells the user to close and reopen the app (you'll get UpdateDownloaded or UpdateFailed). The app is never restarted for them; the update is applied the next time it starts. Later asks again on the next launch.
silent The app checks for updates and downloads them automatically. A downloaded update is applied the next time the app starts.

The mode is part of the app, so set it before you ship the store build that should use it. An update can change it for the builds that install that update.

Checking and applying updates yourself

In manual mode, use the Ota facade, for example from a "Check for updates" button in your settings screen:

Ota::check() returns an array. available is true when there's a newer update for this app. When the phone is offline or the check fails, available is false and reason says why.

Ota::downloadAndApply() checks again, downloads the update, verifies its checksum and size, and queues it. It never restarts your app. The update is applied the next time the app starts, so you might tell the user to restart to finish updating.

Rolling back

Puts the previously downloaded update back, to be applied the next time the app starts. It returns false if there's nothing to roll back to.

Status

pending is true when an update is downloaded and waiting for the next start.

Events

Each step dispatches a Laravel event you can listen for:

Event When
Nativephp\MobileOta\Events\UpdateAvailable A check found an update.
Nativephp\MobileOta\Events\UpdateDownloaded An update was downloaded.
Nativephp\MobileOta\Events\UpdateApplied An update was queued for the next start.
Nativephp\MobileOta\Events\RolledBack A rollback was queued for the next start.
Nativephp\MobileOta\Events\UpdateFailed A check, download, apply or rollback failed. $stage says which, and $message says why.

Safety

Testing

The plugin adds OTA helpers to NativePHP's testing bridge, so your tests can fake updates:

Scripting a check:

Assertions:

The helpers need a NativePHP core whose testing bridge is macroable. On older cores they aren't registered.

License

MIT


All versions of mobile-ota with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
nativephp/mobile Version ^3.0 || ^4.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 nativephp/mobile-ota contains the following files

Loading the files please wait ...