Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native and In-App Purchase? [closed]

I have to build an app for iOS and Android and I was thinking about using React Native to do the job, but I don't find anything regarding In-App Purchase. Do you know any existing solution for adding In-App Purchase to both the iOS and Android version without too much headache?

like image 629
Pym Avatar asked Nov 25 '15 15:11

Pym


People also ask

How do I use in app purchases in React Native?

IMPORTANT: Before you can create your In-App Purchases in android, you are required to activate a Merchant account in your Google Developer account. Click the “Settings” tab from the menu on the left. Scroll to the bottom of this page and you'll see a link to activate your Merchant account.

Does Expo support in app purchases?

expo-in-app-purchases provides an API to accept payments for in-app products. Internally this relies on the Google Play Billing library on Android and the Storekit framework on iOS.

How do you know app is closed in React Native?

With @react-native-community/hooks you can use the useAppState hook to check the app state. When you close the app, it gets a state of unknown once you open it back. When is in background, it says background' or 'inactive'.


1 Answers

I am the author of an InApp Billing library for RN on Android; react-native-billing.

I've been considering also supporting iOS from the same library, but it would require a substantial rewrite since there is some difference in feature-parity. Also the API behaves in different ways.

For now, if you need iOS support as well, I'd use react-native-in-app-utils.

like image 64
cbrevik Avatar answered Oct 11 '22 12:10

cbrevik