IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Store QML Type

Access point to the external market place for in-app purchases.

This type was introduced in QtPurchasing 1.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Store QML Type

  • Import Statement: import QtPurchasing 1.12

  • Since: QtPurchasing 1.0

  • Group: Store is part of qtpurchasing

Detailed Description

When using the Qt Purchasing API in QML, the application should instantiate one Store and then instantiate products as children of this store. The products created as children of the Store object will automatically be queried from the external market place if one is available on the current platform.

The following example registers a store with three products, two consumable products and one unlockable.

 
Sélectionnez
Store {
    Product {
        identifier: "myConsumableProduct1"
        type: Product.Consumable

        // ...
    }

    Product {
        identifier: "myConsumableProduct2"
        type: Product.Consumable

        // ...
    }

    Product {
        identifier: "myUnlockableProduct"
        type: Product.Unlockable

        // ...
    }

    // ...
}

Method Documentation

 

restorePurchases()

Calling this method will cause onPurchaseRestored handlers to be called asynchronously on previously purchased unlockable products. This can be used to restore purchases for unlockable products when the application is run by the same user on multiple devices, or for example if the application has been uninstalled and reinstalled on the device so that the purchase data has been lost.

On some platforms, such as iOS, this will require the user to input their password to launch the restore process. On other platforms, such as Android, it is not typically needed, as the onPurchaseSucceeded handler will be called on any previously purchased unlockable product if the application data is removed.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+