react-native native module for In App Purchase.

Overview

image

Version Next Download Build Status CI document License Vulnerabilities Issue Opened Issue Opened Issue Closed PR Opened PR Closed Greenkeeper badge FOSSA Status

Documentation

Published in website.

Announcement

  • Version 8.0.0 is currently in release candidate. The module is completely rewritten with Kotlin and Swift for maintenenance issue by andresesfm 🔆 . You may install this for early preview.

    yarn add react-native-iap@next
    
  • React Native IAP hook is out. You can see medium post on how to use it.

  • The react-native-iap module hasn't been maintained well recently. We are thinking of participating again and make the module healthier. Please refer to 2021 Maintenance plan and share with us how you or your organization is using it. Happy new year 🎉

    • The sample code is out in Sponsor page in dooboolab.com repository which sadly is rejected by Apple because of lacking product features. I will work on another example project to support this module. More information in #1241 commment.

Introduction

This react-native module will help you access the In-app purchases capabilities of your phone on the Android, iOS platforms and the Amazon platform (Beta).

Keep in mind react-native-iap will provide the basic features you need but is not a turnkey solution, implementing In-app purchases in your app will still require quite some work.
Also, implementing the client side is only one side of the coin, you'll have to implement the server side to validate your receipts (which is probably the most time consuming part to do it correctly).

If you're looking for a module going further than react-native-iap, we recommend using react-native-iaphub which is taking care of everything from the client side to the server side.

⚠️ Most of users experiencing issues are caused by:

Demo

demo.gif

Quick News

  • We had hard time supporting react-native-iap issues that did not provide working codes or any other examples. Therefore, we've decided to make an example app called DoobooIAP, which will contain all the features of IAP's and willing to continuously improve to support real-life examples. @Bang9 who had been helping many others for react-native-iap, is willing to support this repo so he will grant $300 of our income in opencollective as described in #855 🎉 .
  • [email protected] ~ [email protected] is incompatible with react-native <0.61. This is fixed in [email protected] and above.
  • [email protected] has been released. You can see #716 for updates.
  • In the past, react-native-iap@^3.* has been updated very promptly for migration issues. Don't get surprised too much on why it is bumping up version so quickly these days.
    1. Migrated to new AndroidX APIs.
    2. Migrated to new Android billing client which is > 2.0.0.
    3. New Purchase Flow
    4. More is coming in iOS 13.

Breaking Changes

[7.4.0]

  • Now using React's Context to manage IAP state
  • Introduce withIAPContext HOC (how to use)

[7.1.0]

  • androidOldSku is no longer required #1438.

[6.1.0]

  • Creates two variants: play and amazon and only uses the required code.
    NOTE: This would be a breaking change with a very simple fix described in the documentation. To add: `missingDimensionStrategy 'store', 'play'` `in build.gradle`
    
    [3.0.0+] react-native-iap V3 note

Configuration of Google Play & iTunes Connect

  • Please refer to Blog.

Deprecated README

  • If you are using react-native-iap@^2.*, please follow the above README.

Usage

You can look in the RNIapExample/ folder to try the example.

NOTE: To run RNIapExample on Android use the variant flag as follows:

yarn android --variant=MY_VARIANT

where MY_VARIANT is PlayDebug or AmazonDebug

Below is basic implementation which is also provided in RNIapExample project.

If you want more advanced one please refer to dooboolab.com/sponsor.tsx

Sponsoring

Since IAP itself is not perfect on each platform, we desperately need this project to be maintained. If you'd like to help us, please consider being with us in Open Collective.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.

Backers

Please be our Backers.

Contributing

Please make sure to read the Contributing Guide before making a pull request. Thank you to all the people who helped to maintain and upgrade this project!


FOSSA Status

Comments
  • iOS 14: requestSubscription() issues

    iOS 14: requestSubscription() issues

    Version of react-native-iap

    4.4.9

    Version of react-native

    .62.2

    Platforms you faced the error (IOS or Android or both?)

    iOS only. Not testing on Android yet.

    Expected behavior

    Purchase dialog pops up to complete buy and then purchaseUpdatedListener called.

    Actual behavior

    call requestSubscription(). No purchase dialogs. PurchaseUpdatedListener called immediately with no purchase dialogs or valid receipt.

    Tested environment (Emulator? Real Device?)

    Real iOS 14 device using TestFlight.

    Steps to reproduce the behavior

    call RNIap.requestSubscription().

    Notes:

    • XCode 12
    • using Sign In with Apple Id.
    • testing in sandbox with real Apple id (not test user)
    • works fine on iPad running iOS 13.7.
    • have applied iOS 14 promise fix.
    🙏 help wanted 📱 iOS 🍚 need contribution Stale 
    opened by the-dut 63
  • IOS check if autorenewal subscription is still active

    IOS check if autorenewal subscription is still active

    Version of react-native-iap

    2.2.2

    Platforms you faced the error (IOS or Android or both?)

    IOS

    Expected behavior

    Using the RNIAP api we could check if a autorenewal subscription is still active

    Actual behavior

    On android im doing this to check that:

    export const isUserSubscriptionActive = async (subscriptionId) =>{
        // Get all the items that the user has
        const availablePurchases = await getAvailablePurchases();
        if(availablePurchases !== null && availablePurchases.length > 0){
            const subscription = availablePurchases.find((element)=>{
                return subscriptionId === element.productId;
            });
            if(subscription){
                 // check for the autoRenewingAndroid flag. If it is false the sub period is over
                  return subscription["autoRenewingAndroid"] == true;
                }
            }else{
                return false;
            }
        }
    }
    

    On ios there is no flag to check that, and the getAvailablePurchases method returns all the purchases made, even the subscriptions that are not active at the moment.

    Is there a way to check this?

    Regards, Marcos

    📱 iOS 🚶🏻 stale 
    opened by marcosmartinez7 61
  • iOS 14: getProducts() Unknown Error (RN 0.62.2 - 0.63)

    iOS 14: getProducts() Unknown Error (RN 0.62.2 - 0.63)

    RNIap.getProducts() appears to be broken in the latest version of React Native, only returning an unknown error.

    Version of react-native-iap

    4.6.1

    Version of react-native

    0.63.0

    Platforms you faced the error (IOS or Android or both?)

    iOS

    Expected behavior

    products to be fetched.

    Actual behavior

    unknown error being returned

    Tested environment (Emulator? Real Device?)

    iOS Simulator

    Steps to reproduce the behavior

    Just call RNIap.getProducts() or RNIap.getSubscriptions().

    🙏 help wanted 📱 iOS Stale 
    opened by rossbulat 58
  • iOS Receipt Validation Returns Status 21002

    iOS Receipt Validation Returns Status 21002

    Please use the Discussion board if you want to get some help. Please use issues to report bugs.

    Description

    On app startup, I want to check if the auto-renewing subscription is still active or not. I'm using the below code:

    const isSubscriptionActive = async () => {
            if (Platform.OS === 'ios') {
                const availablePurchases = await RNIap.getAvailablePurchases();
                const sortedAvailablePurchases = availablePurchases.sort(
                    (a, b) => b.transactionDate - a.transactionDate
                );
                const latestAvailableReceipt = sortedAvailablePurchases[0].transactionReceipt;
          
                const isTestEnvironment = __DEV__;
                const decodedReceipt = await RNIap.validateReceiptIos(
                    {
                        'receipt-data': btoa(latestAvailableReceipt),
                        password: 'MY_SHARED_SECRET',
                    },
                    isTestEnvironment
                );
                console.log("decodedReceipt: ", decodedReceipt);
                const { latest_receipt_info: latestReceiptInfo } = decodedReceipt;
                console.log("latestReceiptInfo: ", latestReceiptInfo);
                const isSubValid = !!latestReceiptInfo.find(receipt => {
                    const expirationInMilliseconds = Number(receipt.expires_date_ms);
                    const nowInMilliseconds = Date.now();
                    return expirationInMilliseconds > nowInMilliseconds;
                });
                return isSubValid;
            }
        }
    

    However, the decodedReceipt returns {"status": 21002}

    Expected Behavior

    Should return the Receipt Info

    Screenshots

    Environment:

    • react-native-iap: 10.1.0
    • react-native: 0.67.3
    • Platforms (iOS, Android, emulator, simulator, device): iOS - iPhone 12

    To Reproduce Steps to reproduce the behavior:

    1. Make a call to RNIap.initConnection()
    2. Make a call to RNIap.getAvailablePurchases() as shown in isSubscriptionActive method
    3. You'll notice the following output in console:
    decodedReceipt:  {"status": 21002}
    latestReceiptInfo:  undefined
    

    [Optional] Additional Context

    I'm using TypeScript.

    📱 iOS 🍚 need contribution 
    opened by liyamahendra 52
  • purchaseUpdatedListener called multiple times even after purchase

    purchaseUpdatedListener called multiple times even after purchase

    Version of react-native-iap

    5.0.1

    Version of react-native

    0.63.3

    Platforms you faced the error (IOS or Android or both?)

    IOS

    Expected behavior

    purchaseUpdatedListener not getting called multiple times

    Actual behavior

    purchaseUpdatedListener getting called on startup multiple times, sometimes even in between

    Tested environment (Emulator? Real Device?)

    Real device (iOS 14, 13 in Test Flight and in AppStore)

    Steps to reproduce the behavior

    (Navigator Component)

    const itemSkus = ['01', '02'];
    
    const processNewPurchase = async (purchase) => {
      const { productId, transactionReceipt } = purchase;
      if (transactionReceipt !== undefined && transactionReceipt) {
           //backend call with fetch - validating receipt 
            if (data.ack === 'success') {
              console.log('finished');
              await finishTransaction(purchase);
          } else if (data.ack === 'failure') {
              props.setProcessing(false);
              console.log('error');
          }
        }
    };
    
    
    const getProductsIAP = useCallback(async () => {
      await clearProductsIOS();
      await clearTransactionIOS();
    
     try {
       const result = await initConnection();
       const products = await getProducts(itemSkus);
       props.setProducts(products);
       console.log('result', result);
     } catch (err) {
       console.warn(err.code, err.message);
     }
    
      purchaseUpdateSubscription = purchaseUpdatedListener(
        async (purchase) => {
          const receipt = purchase.transactionReceipt;
          console.log('purchaseUpdatedListener');
          if (receipt) {
            try {
              await processNewPurchase(purchase);
            } catch (ackErr) {
               console.log('ackErr', ackErr);
            }
          } else {
            console.log('purchaseUpdatedListener error: receipt');
          }
        },
      );
    
      purchaseErrorSubscription = purchaseErrorListener(
        (error: PurchaseError) => {
          console.log('purchaseErrorListener', error);
          console.log(JSON.stringify(error));
        },
      );
    
      setLoading(false);
    }, []);
    
    
    useEffect(() => {
      getProductsIAP();
    
      return () => {
        if (purchaseUpdateSubscription) {
          purchaseUpdateSubscription.remove();
          purchaseUpdateSubscription = null;
        }
        if (purchaseErrorSubscription) {
          purchaseErrorSubscription.remove();
          purchaseErrorSubscription = null;
        }
      };
    }, []);
    
    
    🙏 help wanted 📱 iOS 👣 waiting for response 
    opened by marcibk 51
  • Android crashes in many devices after release

    Android crashes in many devices after release

    Version of react-native-iap

    "react-native": "0.55.4" "react-native-iap": "^2.3.2"

    Platforms you faced the error (IOS or Android or both?)

    Android

    Expected behavior

    Please help me, I need to fix this immediately. Because there are already +2k users

    Actual behavior

    App crashes because of rniap in many devices. In play console, I saw this error causes the crash : java.lang.RuntimeException:

    1. at com.facebook.react.bridge.CallbackImpl.invoke (CallbackImpl.java:28)
    2. at com.facebook.react.bridge.PromiseImpl.resolve (PromiseImpl.java:30)
    3. at com.dooboolab.RNIap.RNIapModule$4.run (RNIapModule.java:154)
    4. at com.dooboolab.RNIap.RNIapModule$3.onBillingSetupFinished (RNIapModule.java:123)
    5. at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:903)
    6. at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1264)
    7. at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1281)
    8. at android.os.Handler.handleCallback (Handler.java:815)
    9. at android.os.Handler.dispatchMessage (Handler.java:104)
    10. at android.os.Looper.loop (Looper.java:207)
    11. at android.app.ActivityThread.main (ActivityThread.java:5692)
    12. at java.lang.reflect.Method.invoke (Native Method)
    13. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:908)
    14. at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:769)

    Tested environment (Emulator? Real Device?)

    here is the report from play console : https://ibb.co/gDxZQA

    Steps to reproduce the behavior

    I don't know what to do, I used rniap like in example. in componentDidMount : try { const result = await RNIap.initConnection(); } catch (err) { console.log(err); } in componentWillUnmount: RNIap.endConnection();

    🐛 bug 🤖 android 
    opened by umutpiri 45
  • [8.0.4][iOS] finishTransaction promise never finishes

    [8.0.4][iOS] finishTransaction promise never finishes

    Version of react-native-iap

    8.0.4

    Version of react-native

    0.67.2

    Platforms you faced the error (IOS or Android or both?)

    iOS

    Expected behavior

    calling finishTransaction marks the transaction as finished

    Actual behavior

    Any code after the await RNIap.finishTransaction is not executed, and the transaction is reattempted after each relaunch of the app.

    Tested environment (Emulator? Real Device?)

    Real device

    Steps to reproduce the behavior

    Purchase a product in sandbox, call finishTransaction, check if some code after the promise is executed.

    Here is my listener:

    purchaseUpdatedListener = RNIap.purchaseUpdatedListener(
        async (purchase: RNIap.InAppPurchase | RNIap.SubscriptionPurchase) => {
          const receipt = purchase.transactionReceipt;
    
          try {
            if (receipt) {
              const decodedReceipt = await decodeAppleReceipt(receipt);
              const isValid = await isSubValid(decodedReceipt);
    
              if (isValid) {
                const { latest_receipt_info: latestReceipts }: any = decodedReceipt;
                const sortedReceiptInfo = latestReceipts.sort(
                  (
                    a: { original_purchase_date_ms: number },
                    b: { original_purchase_date_ms: number },
                  ) => b.original_purchase_date_ms - a.original_purchase_date_ms,
                );
                let latestReceiptInfo = sortedReceiptInfo[sortedReceiptInfo.length - 1];
                console.log(latestReceiptInfo);
    
                const subPrice = await getSubPrice(latestReceiptInfo.product_id);
                const subDuration = getSubDuration(latestReceiptInfo.product_id);
    
                latestReceiptInfo = {
                  ...latestReceiptInfo,
                  subscription_price: subPrice,
                };
    
                // Persist the purchase on backend API
                const persistedPurchase = await persistSubscriptionIOS(latestReceiptInfo, sessionId);
                const persistedPurchaseId: string = persistedPurchase.persistPurchase.id;
    
                latestReceiptInfo = {
                  ...latestReceiptInfo,
                  persisted_purchase_id: persistedPurchaseId,
                  source: 'ios',
                  subscription_duration: subDuration,
                };
    
    
                // Activate the subscription on backend API
                const deliveryResult = await activateSubscription(latestReceiptInfo, sessionId);
    
                if (isSuccess(deliveryResult)) {
                  console.log('deliveryResult is true');
                  await RNIap.finishTransaction(purchase, false);
                  console.log('finish transaction done');
                  onSuccess?.();
                }
              }
            }
          } catch (error) {
            console.error(error);
          }
        },
      );
    

    The console.log of finish transaction done is never executed, neither my onSuccess callback. However the console.log before finishTransaction is logged.

    📱 iOS 
    opened by aijcoa 41
  • Can't run on iOS due to 'unknown type name 'SKPaymentDiscount'

    Can't run on iOS due to 'unknown type name 'SKPaymentDiscount'

    Version of react-native-iap

    2.4.9

    Version of react-native

    0.59.5

    Platforms you faced the error (IOS or Android or both?)

    iOS

    Expected behavior

    App builds

    Actual behavior

    App doesn't build

    Tested environment (Emulator? Real Device?)

    Emulator

    Steps to reproduce the behavior

    Just react-native run-ios with the above versions of react-native-iap and React native

    This is the exact error I get:

    /node_modules/react-native-iap/ios/RNIapIos.m:167:5: unknown type name 'SKPaymentDiscount'; did you mean 'SKProductDiscount'?

    I tried renaming SKPaymentDiscount to SKProductDiscount just to see and I was getting different errors.

    Let me know if you have any questions.

    📱 iOS ⌛️ legacy 
    opened by dayhaysoos 38
  • In app purchase in expo

    In app purchase in expo

    Hello,

    We are using Expo to create our project. In our project one important topic is in-app purchase. Could you help me how to implement in-app purchase using expo and what are necessary steps we need to follow to implement this.

    ❓ question 🚶🏻 stale 
    opened by Swyanmitra 38
  • [Android] purchaseUpdatedListener firing only once, not on every subscription transaction

    [Android] purchaseUpdatedListener firing only once, not on every subscription transaction

    Version of react-native-iap

    "react-native-iap": "4.5.4",

    Version of react-native

    "react-native": "0.61.4",

    Platforms you faced the error (IOS or Android or both?)

    Android, not tested on iOS

    Expected behavior

    purchaseUpdatedListener firing every time purchase is received

    Actual behavior

    purchaseUpdatedListener firing only once for first recipt, then nothing happens

    Tested environment (Emulator? Real Device?)

    Real device, run in dev env with test google account (subscription recurring every 5 minutes - email is incoming but receipt is not).

    Simplified code I am using:

    import React from 'react';
    import { Text, View, TouchableOpacity, Alert } from 'react-native';
    import RNIap, {
      purchaseUpdatedListener,
      purchaseErrorListener,
    } from 'react-native-iap';
    
    import { SpinnerOverlay } from '../components/SpinnerOverlay';
    
    import { itemSkus } from '../config/in-app';
    import { validateRecipt } from '../utils/validateRecipt';
    import { logger } from '../utils/logger';
    
    export class SubscriptionScreenInner extends React.Component {
      purchaseUpdateSubscription = null;
      purchaseErrorSubscription = null;
    
      constructor(props) {
        super(props);
        this.state = {
          products: [],
          productsLoaded: false,
          isProcessing: false
        };
      }
    
      componentDidMount = async () => {
        try {
          if (itemSkus) {
            await RNIap.initConnection();
            await RNIap.flushFailedPurchasesCachedAsPendingAndroid();
            const products = await RNIap.getSubscriptions(itemSkus);
            this.setState({ products, productsLoaded: true });
    
            this.purchaseUpdateSubscription = purchaseUpdatedListener(
              async (purchase) => {
                try {
                  const receipt = purchase.transactionReceipt;
                  if (receipt) {
                    const validate = await validateRecipt(purchase);
    
                    if (validate) {
                      await RNIap.finishTransaction(purchase, false);
                      this.props.fetchUserProfile();
                      this.resetScreenState();
                      Alert.alert('receipt validated', 'cool');
                    }
                  }
                } catch (error) {
                  this.resetScreenState();
                  logger('Validate recipt error', error);
                }
              }
            );
    
            this.purchaseErrorSubscription = purchaseErrorListener((error) => {
              this.resetScreenState();
              logger('Purchase error during loading', error);
            });
          }
        } catch (error) {
          logger('Store prroducts error', error);
        }
      };
    
      componentWillUnmount() {
        if (this.purchaseUpdateSubscription) {
          this.purchaseUpdateSubscription.remove();
        }
    
        if (this.purchaseErrorSubscription) {
          this.purchaseErrorSubscription.remove();
        }
    
        RNIap.endConnection();
      }
    
      requestSubscription = async (sku) => {
        this.setState({ isProcessing: true }, async () => {
          await RNIap.requestSubscription(sku);
        });
      };
    
      resetScreenState = () => {
        this.setState({ isProcessing: false });
      };
    
      render() {
        const { products, productsLoaded, isProcessing } = this.state;
    
        if (!productsLoaded || isProcessing) {
          return (
            <View>
              <SpinnerOverlay />
            </View>
          );
        }
    
        return (
          <View>
            <View>
              <View>
                <View>
                  <Text>Buy monthly subscription</Text>
                </View>
    
                <View>
                  <TouchableOpacity onPress={() => this.requestSubscription(products[0].productId)}>
                    <Text>Buy</Text>
                  </TouchableOpacity>
                </View>
              </View>
            </View>
          </View>
        );
      }
    }
    
    🙏 help wanted 🤖 android 🧪 test Stale 
    opened by mtuzalci 37
  • RNIap is not working on Android but works in iOS with same code

    RNIap is not working on Android but works in iOS with same code

    Version of react-native-iap 4.4.7

    Version of react-native 0.60.6

    Platforms you faced the error (IOS or Android or both?) Android

    Expected behavior

         async componentDidMount() {
            try {
                const result = await RNIap.initConnection();
                await RNIap.consumeAllItemsAndroid();
                console.log('result', result);
                const products: Product[] = await RNIap.getProducts(itemSkus);
                this.setState({ products }, () => {console.log(this.state.products)});
            } catch (err) {
                console.warn(err.code, err.message);
            }
    

    Expected behavior is a list of products pulled from play console by .getProducts() printed in terminal

    Actual behavior Promise is not returned. Error 'billing is not available'

    Tested environment (Emulator? Real Device?) Real Device (App is currently in production)

    Steps to reproduce the behavior const itemSkus = Platform.select({ ios: [ 'com.example.1' ], android: [ 'com.example.1' ] });

         async componentDidMount() {
            try {
                const result = await RNIap.initConnection();
                await RNIap.consumeAllItemsAndroid();
                console.log('result', result);
                const products: Product[] = await RNIap.getProducts(itemSkus);
                this.setState({ products }, () => {console.log(this.state.products)});
            } catch (err) {
                console.warn(err.code, err.message);
            }
    
        this.purchaseUpdateSubscription = purchaseUpdatedListener(async (purchase: InAppPurchase | SubscriptionPurchase | ProductPurchase) => {
            console.log('purchaseUpdatedListener', purchase);
            const receipt = purchase.transactionReceipt;
            if (receipt) {
                try {
                    // if (Platform.OS === 'ios') {
                    //   finishTransactionIOS(purchase.transactionId);
                    // } else if (Platform.OS === 'android') {
                    //   // If consumable (can be purchased again)
                    //   consumePurchaseAndroid(purchase.purchaseToken);
                    //   // If not consumable
                    //   acknowledgePurchaseAndroid(purchase.purchaseToken);
                    // }
                    const ackResult = await finishTransaction(purchase);
                } catch (ackErr) {
                    console.warn('ackErr', ackErr);
                }
    
                this.setState({ receipt }, () => this.goNext());
            }
        },
        );
    
        this.purchaseErrorSubscription = purchaseErrorListener(
            (error: PurchaseError) => {
                console.log('purchaseErrorListener', error);
            },
        );
    }
    componentWillUnmount() {
        if (this.purchaseUpdateSubscription) {
            this.purchaseUpdateSubscription.remove();
            this.purchaseUpdateSubscription = null;
        }
        if (this.purchaseErrorSubscription) {
            this.purchaseErrorSubscription.remove();
            this.purchaseErrorSubscription = null;
        }
    }
    

    I can't seem to figure out why this is. I'm using this exact code for iOS and it works perfectly. I have set up all products in the play console, added billings permission to the manifest file, and linked IAP package (I'm using AndroidX so the package is auto-linked). I am logged into the play store and I have the latest version of the play store, but initConnection() is still not working. I don't know what else to do. Any help is greatly appreciated! Thank you for reading.

    🙏 help wanted 🤖 android Stale 
    opened by damialajogun 37
  • purchaseUpdatedListener is called multiple times on android

    purchaseUpdatedListener is called multiple times on android

    Please use the Discussion board if you want to get some help. Please use issues to report bugs.

    purchaseUpdatedListener is called multiple times on android

    to be called once per payment.

    Screenshots

    Environment:

    • react-native-iap: ^12.4.9
    • react-native: 0.70.6
    • Platforms (iOS, Android, emulator, simulator, device): Android only device

    To Reproduce Steps to reproduce the behavior:

    1. Basic setup.
    2. Try to buy something from a real android device.
    3. You will get multiple purchases from the listener.

    [Optional] Additional Context

    🤖 android ℹ needs more info 
    opened by kabus202 5
  •  after invoke

    after invoke "clearTransactionIOS" then app crash said "Cannot finish a purchasing transaction"

    Please use the Discussion board if you want to get some help. Please use issues to report bugs.

    Description

    after invoke "clearTransactionIOS" then app crash said "Cannot finish a purchasing transaction" see attaachment

    Expected Behavior

    Screenshots

    Screen Shot 2022-12-12 at 18 55 46

    Environment:

    • react-native-iap: 8.0.8
    • react-native:0.86
    • Platforms (iOS, Android, emulator, simulator, device): ios

    To Reproduce Steps to reproduce the behavior:

    code invoked

    await iap.clearTransactionIOS(); await purchaseSubscription(subId).catch((error) => { if (error && error.code !== 'E_USER_CANCELLED') { SubscriptionActions.log({ source: 'purchaseProduct:purchase_error', error, subId }); console.warn('subscribe error', subId, error); } });

    and see some crashes on firebase
    

    [Optional] Additional Context

    📱 iOS ⌛️ legacy 
    opened by sbin1211 0
  • Setup storekitMode blocks debugger

    Setup storekitMode blocks debugger

    Description

    When we execute setup({ storekitMode: <store_kit_mode> });

    We no longer able to use Debugger in debug mode.

    Expected Behavior

    When setting storekit mode, debug is not broken

    Screenshots

    Screenshot 2022-12-11 at 22 49 56

    Environment:

    • react-native-iap: 12.4.8
    • react-native: 0.69.7
    • Platforms (iOS, Android, emulator, simulator, device): iOS 16.1 simulator
    • React Native Debugger: 0.13.0

    To Reproduce Steps to reproduce the behavior:

    1. Enable debug mode in simulator/emulator
    2. Open React Native Debugger/Chrome DevTools
    3. Error 'Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.' is shown
    📱 iOS 
    opened by professorkolik 6
  • Incomplete documentation for a beginner

    Incomplete documentation for a beginner

    Thank you for your work! I'm trying to figure out how IAP works and I need to choose between "With Android Support" and "With AndroidX". Since I'm a beginner (I came from web) I have no idea what to choose. Can you help me and update the docs with new information? Thank you!

    1️⃣ good first issue 📖 documentation 
    opened by finom 0
  • IOS App Getting with In-App Purchase getting rejected in Apple

    IOS App Getting with In-App Purchase getting rejected in Apple

    Description

    Apple is rejecting our app with in app purchase. Apple says that “We still found that while you have submitted in-app purchase products for your app, the in-app purchase functionality is not present in your binary”. Has anybody experienced this issue using react-native-iap plugin? What is the fix for this issue? Thank you!

    Environment:

    • react-native-iap: 8.0.4
    • react-native: 0.64.3
    • Platforms (iOS, Android, emulator, simulator, device): IOS
    📱 iOS ⌛️ legacy 
    opened by sajubusinesscompassllc 2
  • Purchase dialog hangs in Amazon Fire devices on Live App Testing

    Purchase dialog hangs in Amazon Fire devices on Live App Testing

    Description Everything works as expected while testing locally using Amazon's App Tester. However, after promoting the app to Amazon's Live App Testing, I'm experiencing a weird issue where the purchase dialog doesn't show up after calling requestSubscription method. It would just hang.

    This is what I get from looking at the logcat that seems related:

    D/Kiwi: ForegroundTaskPipeline: No UI visible to execute task: com.amazon.device.iap.internal.a.e.a$1@aa2220c, placing into pending queue until task is visible

    The only way I can get the dialog to show is by clicking on the Overview/Recents square button in Android's navigation(let's you access other apps that are open) that would eventually force the app to go the background. When the app comes back to the foreground, the dialog will show and will keep showing normally.

    I wonder if this is happening to someone else in the community.

    I have implemented IAP(Subscriptions) for both Google and Apple Stores and they work just fine. This issue only happens on Amazon IAP.

    Expected Behavior

    Purchase dialog should pop up when calling requestSubscription method.

    Environment:

    • react-native-iap: 12.4.4
    • react-native: 0.65.1
    • Platforms (Android): Fire OS
    👣 waiting for response ⓐ amazon 
    opened by dduranalba 3
Releases(12.4.12)
  • 12.4.12(Jan 5, 2023)

    What's Changed

    • improve documentation by using different method names instead of overloading by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2182
    • Fix empty subscriptions list by removing filter by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2187

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.11...12.4.12

    Source code(tar.gz)
    Source code(zip)
  • 12.4.11(Jan 3, 2023)

    What's Changed

    • android legacy price compat by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2181

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.10...12.4.11

    Source code(tar.gz)
    Source code(zip)
  • 12.4.10(Jan 3, 2023)

    What's Changed

    • Update getReceiptIOS documentation by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2153
    • Bump json5 from 2.2.1 to 2.2.3 in /docs by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2178
    • Bump json5 from 2.2.1 to 2.2.3 by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2179
    • fix setting iOS subscription type for one-time subscriptions by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2180

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.9...12.4.10

    Source code(tar.gz)
    Source code(zip)
  • 12.4.9(Dec 5, 2022)

    What's Changed

    • Updated documentation by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2143
    • Bump decode-uri-component from 0.2.0 to 0.2.2 in /IapExample by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2148
    • Bump decode-uri-component from 0.2.0 to 0.2.2 by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2150
    • fix type error on some versions of xcode by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2152

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.8...12.4.9

    Source code(tar.gz)
    Source code(zip)
  • 12.4.8(Nov 29, 2022)

    What's Changed

    • mapping from sk2 transaction to purchase result by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2141

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.7...12.4.8

    Source code(tar.gz)
    Source code(zip)
  • 12.4.7(Nov 29, 2022)

    What's Changed

    • finish transaction returns true on iOS by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2139

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.6...12.4.7

    Source code(tar.gz)
    Source code(zip)
  • 12.4.6(Nov 29, 2022)

    What's Changed

    • option to include all transactions in Userhistory by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2134

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.5...12.4.6

    Source code(tar.gz)
    Source code(zip)
  • 12.4.5(Nov 28, 2022)

    What's Changed

    • Bump loader-utils from 2.0.3 to 2.0.4 in /docs by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2114
    • Update request-purchase-with-offer.md by @jbernhardt23 in https://github.com/dooboolab/react-native-iap/pull/2108
    • fixes transaction date types to be ints on iOS by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2133

    New Contributors

    • @jbernhardt23 made their first contribution in https://github.com/dooboolab/react-native-iap/pull/2108

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.4...12.4.5

    Source code(tar.gz)
    Source code(zip)
  • 12.4.4(Nov 9, 2022)

    What's Changed

    • Add amazon module Unit Tests by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2104

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.3...12.4.4

    Source code(tar.gz)
    Source code(zip)
  • 12.4.3(Nov 9, 2022)

    What's Changed

    • Bump loader-utils from 2.0.2 to 2.0.3 in /docs by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2101
    • add basic validation for skus by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2105

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.2...12.4.3

    Source code(tar.gz)
    Source code(zip)
  • 12.4.2(Nov 4, 2022)

    What's Changed

    • fix getavailableItems parameter by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2098

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.1...12.4.2

    Source code(tar.gz)
    Source code(zip)
  • 12.4.1(Nov 3, 2022)

    What's Changed

    • fix amazon available items by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2096

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.4.0...12.4.1

    Source code(tar.gz)
    Source code(zip)
  • 12.4.0(Nov 2, 2022)

    What's Changed

    • remove type in doc by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2087
    • onlyIncludeActiveItems ios sk2 by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2091

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.3.4...12.4.0

    Source code(tar.gz)
    Source code(zip)
  • 12.3.4(Nov 1, 2022)

    What's Changed

    • Bump vm2 from 3.9.10 to 3.9.11 by @dependabot in https://github.com/dooboolab/react-native-iap/pull/2086
    • refund request only available on iOS by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2088

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.3.3...12.3.4

    Source code(tar.gz)
    Source code(zip)
  • 12.3.3(Oct 31, 2022)

    What's Changed

    • docs: Fixed a typo in the example code by @Abdelalim-dev in https://github.com/dooboolab/react-native-iap/pull/2080
    • made getPendingTransactions consistent with sk1 by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2085

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.3.2...12.3.3

    Source code(tar.gz)
    Source code(zip)
  • 12.3.2(Oct 21, 2022)

    What's Changed

    • fixing original Transaction ID by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2072

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.3.1...12.3.2

    Source code(tar.gz)
    Source code(zip)
  • 12.3.1(Oct 21, 2022)

    What's Changed

    • The promise should not resolve here by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2064

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.3.0...12.3.1

    Source code(tar.gz)
    Source code(zip)
  • 12.3.0(Oct 19, 2022)

    What's Changed

    • ktlint for android by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2052
    • docs: expand update listener FAQ by @mayfairr in https://github.com/dooboolab/react-native-iap/pull/2053
    • Update RNIap.podspec by @aurelienmartin in https://github.com/dooboolab/react-native-iap/pull/2056
    • Added support for showManageSubscriptions on Storekit 2 by @timbrandin in https://github.com/dooboolab/react-native-iap/pull/2058

    New Contributors

    • @mayfairr made their first contribution in https://github.com/dooboolab/react-native-iap/pull/2053
    • @aurelienmartin made their first contribution in https://github.com/dooboolab/react-native-iap/pull/2056
    • @timbrandin made their first contribution in https://github.com/dooboolab/react-native-iap/pull/2058

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.2.0...12.3.0

    Source code(tar.gz)
    Source code(zip)
  • 12.2.0(Oct 17, 2022)

    What's Changed

    • Changes Singletons to Kotlin-style objects by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2050
    • Implemented beginRefundRequest by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2051

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.1.2...12.2.0

    Source code(tar.gz)
    Source code(zip)
  • 12.1.2(Oct 13, 2022)

    What's Changed

    • Fix missing prorationModeAndroid causing crash by @hsource in https://github.com/dooboolab/react-native-iap/pull/2046

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.1.1...12.1.2

    Source code(tar.gz)
    Source code(zip)
  • 12.1.1(Oct 12, 2022)

    What's Changed

    • requestReceipt only available on Sk1 by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2045

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.1.0...12.1.1

    Source code(tar.gz)
    Source code(zip)
  • 12.1.0(Oct 12, 2022)

    What's Changed

    • fix documentation by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2035
    • fix documentation for android validate receipt by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2041
    • Lint and run tests as part of yarn prepare to improve safety by @hsource in https://github.com/dooboolab/react-native-iap/pull/2038
    • Fix getSubscriptions Android types; add platform enum and tests by @hsource in https://github.com/dooboolab/react-native-iap/pull/2039

    New Contributors

    • @hsource made their first contribution in https://github.com/dooboolab/react-native-iap/pull/2038

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.0.3...12.1.0

    Source code(tar.gz)
    Source code(zip)
  • 12.0.3(Oct 7, 2022)

    What's Changed

    • Revert methods to known working versions (android and ios validate receipt methods) by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2030

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.0.2...12.0.3

    Source code(tar.gz)
    Source code(zip)
  • 12.0.2(Oct 6, 2022)

    What's Changed

    • make it optional and add doc on wher to find it by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2025

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.0.1...12.0.2

    Source code(tar.gz)
    Source code(zip)
  • 12.0.1(Oct 5, 2022)

    What's Changed

    • using the proper data structure by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2019
    • clearTransaction ios sk2 by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2020

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/12.0.0...12.0.1

    Source code(tar.gz)
    Source code(zip)
  • 12.0.0(Oct 5, 2022)

    What's Changed

    • amazon appstore sdk 3 by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2006

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/11.0.7...12.0.0

    Source code(tar.gz)
    Source code(zip)
  • 11.0.7(Sep 29, 2022)

    What's Changed

    • fix missing error sk2 tvOS by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2012

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/11.0.6...11.0.7

    Source code(tar.gz)
    Source code(zip)
  • 11.0.6(Sep 29, 2022)

    What's Changed

    • Using IapError instead of Sk1 function by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2011

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/11.0.5...11.0.6

    Source code(tar.gz)
    Source code(zip)
  • 11.0.5(Sep 28, 2022)

    What's Changed

    • Sk2 support for tvOS 15 and higher by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2008

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/11.0.4...11.0.5

    Source code(tar.gz)
    Source code(zip)
  • 11.0.4(Sep 27, 2022)

    What's Changed

    • 'IAP_NOT_AVAILABLE' was added back by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2004
    • Add multiple calls to listener FAQ by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2005
    • fix Objective c parameter by @andresesfm in https://github.com/dooboolab/react-native-iap/pull/2007

    Full Changelog: https://github.com/dooboolab/react-native-iap/compare/11.0.3...11.0.4

    Source code(tar.gz)
    Source code(zip)
Owner
dooboolab
Open Source Community. Slack: https://dooboolab.com/joinSlack
dooboolab
This perfect starter kit is an app based on React Native and UI Kitten library with Light and Dark themes support.

Kitten Tricks This perfect starter kit is an app based on React Native and UI Kitten library with Light and Dark themes support. It’s completely free

Akveo 7k Dec 30, 2022
Flutter's [FlatList] widget for React Native friendly developers

FlatList for Flutter [FlatList] widget in Flutter which will be familiar to React Native developers. Motivation While there are opinionated ways to bu

Hyo 5 Dec 21, 2022
Flutter ticket pass - A Flutter Widget to display the details of a ticket/pass purchased by customers and display the details of the purchase

ticket_pass_package A Flutter package to display the purchase of a ticket/pass along with additional details such as list of buyers. The source code i

null 40 Aug 13, 2022
Flutter Application to purchase movie tickets, search for a movie, view movie details and proceed to select seats and movie times.

Flutter Application to purchase movie tickets, search for a movie, view movie details and proceed to select seats and movie times.

Stanley Valenzuela 6 May 25, 2022
Trying out Flutter for desktop Web app development as an alternative to SPA frameworks (such as React and Angular) by recreating one of the pages of an existing CV Management web app

HTML Renderer Demo CanvasKit Renderer Demo Reddit discussion This repo contains a PoC of using Flutter as a traditional SPA framework for creating a d

Maxim Saplin 20 Oct 11, 2022
Flutter React Golang WebRTC等技术学习笔记

study-notes Flutter React Golang WebRTC等技术学习笔记 学习资源 除了一些文章外,亢老师还精心录制了一些视频教程供大家学习. 国内用户请查看核心系列课程(国内). 海外华人用户请查看核心系列课程(海外), 支持paypal支付.可放心购买 核心系列课程(国内)

亢少军 15 Nov 11, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo

Flutter GraphQL Table of Contents Flutter GraphQL Table of Contents About this project Installation Usage GraphQL Provider [Graphql Link and Headers]

Snowball Digital 45 Nov 9, 2022
Intel Corporation 238 Dec 24, 2022
Hangman module for CITMATEL's 'strawberry' project

citmatel_strawberry_hangman Hangman module for CITMATEL's 'strawberry' project Getting Started This project is a starting point for a Flutter applicat

null 2 Jan 6, 2023
Drag and drop module for CITMATEL's 'strawberry' project

citmatel_strawberry_dnd Drag and drop module for CITMATEL's 'strawberry' project Getting Started This project is a starting point for a Flutter applic

null 2 Jan 6, 2023
Trivia module for CITMATEL's 'strawberry' project

citmatel_strawberry_trivia Módulo de trivia para el videojuego de CITMATEL Getting Started This project is a starting point for a Flutter application.

null 1 Jan 21, 2022
Pdf creation module for dart/flutter

Pdf for Dart and Flutter This set of plugins allows Flutter apps to generate and print pdf files to the device printer. This plugin works for iOS and

David PHAM-VAN 954 Jan 3, 2023
Magpie is a visualized platform which designed to create, develop and compile your standalone flutter module.

Magpie Workflow is a visualized platform which is designed to create, develop and compile your standalone flutter module;

Wuba 124 Dec 4, 2022
Dart module for communicating with the Veryfi OCR API

Dart module for communicating with the Veryfi OCR API Installation Install from https://pub.dev/packages/veryfi_dart Getting Started Obtaining Client

Veryfi 8 Dec 28, 2022
🧡 The neuralgic heart of the application, this module gathers all the functionalities of the framework.

Mineral Mineral is a robust, powerful and scalable framework designed to let you develop discord bots with the Dart language. The Mineral framework cu

mineral.dart 16 Dec 26, 2022
how to Integrating facebook audience network to flutter app for banner, interstitial, rewarded, native and native banner

fb_ads_flutter_12 A new Flutter project. Getting Started Watch the complite tutorial for integrating Facebook ads into the Flutter app in our Youtube

null 4 Nov 26, 2022
dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Assuner 14 Jul 11, 2022
Flutter native ads - Show AdMob Native Ads use PlatformView

flutter_native_ads Flutter plugin for AdMob Native Ads. Compatible with Android and iOS using PlatformView. Android iOS Getting Started Android Androi

sakebook 64 Dec 20, 2022