How to use the react-native-iap.finishTransactionIOS function in react-native-iap

To help you get started, we’ve selected a few react-native-iap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esteemapp / esteem-mobile / src / containers / inAppPurchaseContainer.js View on Github external
.then(() => {
            if (Platform.OS === 'ios') {
              RNIap.finishTransactionIOS(get(purchase, 'transactionId'));
            } else if (Platform.OS === 'android') {
              RNIap.consumePurchaseAndroid(token);
            }
            this.setState({ isProcessing: false });

            if (fetchData) {
              fetchData();
            }
          })
          .catch(err =>
github raindropio / mobile / src / screens / settings / pro / buy / module.js View on Github external
export const validatePurchase = async (purchase, userId)=>{
    const endpoint = process.env.NODE_ENV == 'production' ? 'https://billing.raindrop.io/v1' : Config.BILLING_DEV_ENDPOINT
    let res

    switch(Platform.OS) {
        case 'ios':
            res = await Api._post(`${endpoint}/apple/inapp`, {
                userId, 
                receipt: purchase.transactionReceipt
            })

            if (res.result)
                RNIap.finishTransactionIOS(purchase.transactionId)
        break

        case 'android':
            res = await Api._post(`${endpoint}/google/inapp`, {
                userId,
                product_id:     purchase.productId,
                token:          purchase.purchaseToken,
                etc:            purchase.dataAndroid
            })

            if (res.result)
                RNIap.consumePurchaseAndroid(purchase.purchaseToken)
        break
    }

    if (res.result)