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?
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.
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.
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'.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With