How to use the react-native-iap.requestPurchase 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 guardian / editions / projects / Mallard / src / hooks / use-subscribe.ts View on Github external
const subscribeToSKU = useCallback((productId: string) => {
        try {
            RNIAP.requestPurchase(productId)
        } catch (err) {
            console.warn(err.code, err.message)
        }
    }, [])
github raindropio / mobile / src / screens / settings / pro / buy / module.js View on Github external
export const buyProduct = async (productId)=>{
    console.log('aaa111', `Try to buy ${productId}`)

    return await RNIap.requestPurchase(productId, false)
}
github esteemapp / esteem-mobile / src / containers / inAppPurchaseContainer.js View on Github external
_buyItem = async sku => {
    const { navigation } = this.props;

    if (sku !== 'freePoints') {
      await this.setState({ isProcessing: true });

      try {
        RNIap.requestPurchase(sku, false);
      } catch (err) {
        bugsnag.notify(err, report => {
          report.metadata = {
            sku,
          };
        });
      }
    } else {
      navigation.navigate({
        routeName: ROUTES.SCREENS.SPIN_GAME,
      });
    }
  };