inAppPurchase

    进程:主进程

    inAppPurchase 模块触发以下事件:

    一个或多个 transactions 更新时会触发这一事件。

    • transactions Transaction[] - Array of objects.

    方法

    模块包含以下方法:

    inAppPurchase.purchaseProduct(productID[, quantity])

    • productID String - 预付款商品的ID (com.example.app.product1 的ID是 product1).
    • quantity Integer (可选) - 用户所要购买的商品数量.

    Returns Promise<Boolean> - Returns true if the product is valid and added to the payment queue.

    在调用purchaseProduct之前,你应该尽可能快的监听transactions-updated事件

    • productIDs String[] - 预购商品ID

    检索商品的描述

    inAppPurchase.canMakePayments()

    返回 Boolean, 用来判断用户是否可以发起支付.

    返回 String, 指收据路径.

    inAppPurchase.finishAllTransactions()

    完成与日期对应的待处理事务