This article explains the process by which you update published apps, either self-published or published on the Firefox Marketplace.
Once an app has been installed by a user it's not possible to change the app name through an update. New installations will, however, pick up the new app name. This is a security measure to guard against unscrupulous name changes.
Updating Hosted Apps
Hosted Apps respect the normal rules for Web caching, and may use advanced mechanisms for improved start-up or to enable offline use, such as AppCache. Given this, there are normally no special considerations for updating these apps — you simply update the app on your site.
However, some changes to your apps may involve updates to the manifest.
Changing a manifest’s content
To update features of a published app — such as the app name, developer name, locales, icons or app name — you simply apply these changes to the manifest you host. If you've submitted the app to Firefox Marketplace and any of these changes are considered significant the app is flagged for review.
The Web runtimes and Firefox OS should automatically detect these changes and trigger an update on the user’s device. However, you can manually trigger updates by providing a version field in the app manifest. Your app can then check the version by inspecting the return value of
Apps.getInstalled. If the user's installed version is not up-to-date, your app can trigger an update using
Apps.install. Note that some changes to a manifest, and hence the installation, may require user approval before the update is actioned.
The value of version isn't used by Firefox OS or the Web runtimes, so you can use whatever version scheme you want.
Changing a manifest's location
You may wish to change the location of your app’s manifest file. Typically you'll do this to move the app to a new domain or to a sub-domain to enable you to deliver multiple hosted apps.
If you wish to do this for apps submitted to Firefox Marketplace, return to the app submission and on the Edit Details page change the Manifest URL value. What happens next will depend on the status of your app:
- for a published (or approved but not published) app, the app is flagged for review and you’ll be contacted if (and only if) any subsequent problems are discovered.
- for unapproved apps, the review will proceed as normal.
When a Hosted App is flagged for review as the result of an update, the following happens:
- The app’s status doesn’t change, a published app remains published.
- The app is added to the review queue and when it pops from the queue (anything from a few hours to a few days later) a reviewer will examine the changes and:
- clear the flag.
- if the app is completely broken, reject it and contact you. This will remove the app from Firefox Marketplace, if it has been published.
- contact you for further information.
Where possible you should avoid changing the location of the app/manifest after your app has been published in the Firefox Marketplace. This is because of the impact on the user. A change in the manifest location will result in a new installed instance of the app when
Apps.install is invoked. Many users will find this confusing.
Updating Packaged Apps
Packaged Apps have a different update process to Hosted Apps. To update a Packaged App, you upload a new version of the app's zip file to the Firefox Marketplace. The updated app is then reviewed and, when approved, published to the Marketplace. This triggers an update to any installed versions. Firefox OS device users can also request an update using the Settings app. To upload a new version of your application, sign in to marketplace with the same account as the original submission by clicking on the gear icon in the top right and clicking "My Submissions." Under the header "Manage My Submissions" and the app in question, click "Status & Versions." From there, scroll down and click on "Select a File" under "Upload New Version." From there, you can choose not have an app automatically published upon review if you wish by unchecking the box that reads "Publish my app in the Firefox Marketplace as soon as it's reviewed." Users' devices will check daily for app updates, and will see a notification that an update for their app is available for download at their discretion.
- When the updated packaged app is published, the mini-manifest is updated to point to the updated zip file (the mini-manifest is not the main app manifest). The
ETagheader is changed, and this triggers an update on the Firefox OS phone.
- Firefox OS on the phone polls once per day for changes to an app. To do this, it polls the URL of the mini-manifest, then polls the URL in the
package_pathfield in the mini-manifest. This is done using the
checkForUpdate()method on the
Appobject. When the
ETagheader changes, it knows the app has been updated. Then it checks if the zip file has changed.
- Firefox OS checks in a batch for app updates.