inAppPurchase
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
In-App-Käufe im Mac App Store.
Process: Main
Ereignisse
Das inAppPurchase Modul sendet folgende Ereignisse aus:
Event: 'transactions-updated'
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
Kehrt zurück:
eventEventtransactionsTransaction[] - Array of Transaction objects.
Wird ausgelöst, wenn eine oder mehrere transactions aktualisiert wurden.
Methoden
Das Modul inAppPurchase verfügt über die folgenden Methoden:
inAppPurchase.purchaseProduct(productID[, opts])
History
| Version(s) | Changes |
|---|---|
None | This method now returns a Promise instead of using a callback function. |
None | Added |
None | API ADDED |
productIDzeichenketteoptsInteger | Object (optional) - Definiert die Menge, wenn als Integer angegeben.quantityInteger (optional) - Anzahl der Gegenstände, die der Benutzer kaufen möchte.usernamestring (optional) - Der string, der die Transaktion mit einem Benutzerkonto auf Ihrem Dienst (applicationUsername) verknüpft.
Gibt Promise<boolean> zurück - Gibt true zurück, wenn das Produkt gültig ist und zur Zahlungswarteschlange hinzugefügt wurde.
You should listen for the transactions-updated event as soon as possible and certainly before you call purchaseProduct.
inAppPurchase.getProducts(productIDs)
History
| Version(s) | Changes |
|---|---|
None | This method now returns a Promise instead of using a callback function. |
None | API ADDED |
productIDsstring[] - Die Identifikatoren des zu erhaltenden Produktes.
Returns Promise<Product[]> - Resolves with an array of Product objects.
Ruft die Produktbeschreibungen ab.
inAppPurchase.canMakePayments()
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
Gibt boolean zurück - ob ein Benutzer eine Zahlung leisten kann.
inAppPurchase.restoreCompletedTransactions()
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
Restores finished transactions. This method can be called either to install purchases on additional devices, or to restore purchases for an application that the user deleted and reinstalled.
The payment queue delivers a new transaction for each previously completed transaction that can be restored. Each transaction includes a copy of the original transaction.
inAppPurchase.getReceiptURL()
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
Gibt string zurück - den Pfad zur Quittung.
inAppPurchase.finishAllTransactions()
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
Erledigt alle ausstehenden Transaktionen.
inAppPurchase.finishTransactionByDate(date)
History
| Version(s) | Changes |
|---|---|
None | API ADDED |
datestring - The ISO formatted date of the transaction to finish.
Completes the pending transactions corresponding to the date.