Creating your own store

This translation is incomplete. Please help translate this article from English

La méthode d'installation et de gestion des applications dans Firefox OS, Firefox pour Android et Firefox pour PC de bureau est indépendant de Firefox Marketplace. Cela ouvre la possibilité pour vous de non seulement auto-publier des applications, mais aussi pour créer et héberger votre propre marché. En fin de compte, vous pouvez aussi mettre en place un marché indépendant en utilisant le logiciel open source. Cette page décrit les options et donne un aperçu de la mise en œuvre de chaque.

vos options

Les trois principales options que vous pouvez utiliser pour créer votre propre boutique sont:

     Procédé d'annuaire
     méthode de magasin
     remplir la mise en œuvre du marché

Ces options sont décrites plus en détail ci-dessous.

Remarque: les applications peuvent être limités à l'installation à partir d'une liste des origines autorisés avec la installs_allowed_from bien manifeste. Vous aurez besoin de confirmer que cette propriété n'est pas définie pour exclure l'origine de votre magasin lors de l'inscription applications.

Directory method

Here you create a directory of apps served by the Firefox Marketplace, making use of the Firefox Marketplace API to retrieve information on the apps. You would then need to implement your own Web pages to display details of the apps and trigger their installation. With this method you can serve any app that is available on Firefox Marketplace, but you won't generate a revenue stream for paid apps.
You can find an example of this method of store creation in TheCount. At the time of writing, to see the example in action click apps with at least 30 ratings and open any of the listed apps. In the app's details page you'll see an install button directly below the title, as shown below.

The installation button for an app with at least 30 ratings in TheCount, a stats and reporting website.

You can find the code used to implement the button in the project's Github repository.

Store method

Here you work independently of the Firefox Marketplace providing a list of self-published apps that are installed using Apps.install or Apps.installPackage. The self-published apps can either be hosted by you or another developer. This method limits you to apps that can be self-published, that is, you cannot serve Packaged Apps using Privileged and Certified APIs.

Full Marketplace implementation

Here you implement the various components of Marketplace (zamboni plus other components such as Solitude and WebPay, if you want to implement payments). For more information, please see the zamboni documentation.

Useful APIs

When implementing the directory or store methods, you'll find the following APIs of use.

Interacting with Marketplace

When using the directory method you'll need to access and use details of the apps available in Marketplace. The key APIs for these tasks are:

  • App lists — GET /api/v1/apps/search/ — this API enables you to get a list of Marketplace apps based on a query string, similar to the query strings you see when searching the Web version of Marketplace.
  • App's details — GET /api/v1/apps/app/ — this API enables you to get the details of an individual app, such as its author and icons.

To find more information on these APIs and others that might be useful, please see the Firefox Marketplace API documentation.

Managing apps on a device

You'll probably be familiar with Apps.install or Apps.installPackage already, the APIs used to install Packaged  Apps and Hosted Apps. These APIs are part of the navigator.mozApps JavaScript object, which includes several other APIs that can communicate with a Firefox OS device or browser to gather information on installed apps.

For example, the navigator.mozApps.getInstalled() method enables you to get a list of the apps that were installed in the current user agent by your domain. You'll not see apps installed by other domains, only the ones that you put there. You can use this method to determine whether the user's installed apps match your expectations, or to implement a "resync" feature if the user signs into your site from a new profile.

For more details, please see App Installation and Management APIs.

Other information

If you're delivering Hosted Apps, you can easily maintain a session with the user to track preferences, proof-of-purchase, or other additional services. If you're providing services to a remotely Hosted App, you'll need to do some additional work to support a distributed authentication system.