React Native In App Purchase

dooboolab
dooboolab
Apr 8, 2018 · 2 min read

I’ve implemented react-native-iap module 6 months ago and lots of people are asking specific steps to integrate the module to their own react-native project. Therefore I’ve decided to write a guide to setup in app purchase in both ios and android platforms so that I can help your life easier. Also recently, I’ve implemented flutter_inapp_purchase module. React Native In App Purchase and Flutter In App Purchase is ready.

Setup your in app products for ios in itunesconnect.

  1. You need to complete the Agreements, Tax and Bankings.
  2. Add In-App Purchases in Features tab. Check that your product’s status is Ready to Submit.

3. Check your xcode setting and make In-App Purchase available.

Setup your in-app purchases for android in playstore.

  1. As described in above screenshot, you need to upload apk with billing permission and set up merchant account before creating in-app product.
    <uses-permission android:name="com.android.vending.BILLING" />
  2. If you’ve done it, you can create a managed product as shown in below screenshot.

Summary for integrating react-native-iap.

  1. npm install — save react-native-iap
  2. react-native link react-native-iap
  3. Prepare In App billing, then buyProduct.
import * as RNIap from 'react-native-iap';...
try {
await RNIap.prepare();
const products = await RNIap.getProducts(itemSkus);
this.setState({ items });
} catch(err) {
console.warn(err);
}

Please write up issue, if you have any problem.

Thank you.

dooboolab

Open source community

dooboolab

Written by

dooboolab

dooboolab

dooboolab

Open source community

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade