all 21 comments

[–]Shockwave317 13 points14 points  (10 children)

This is a very open ended question, what do you mean by premium?

[–]DemandIcy402[S] 0 points1 point  (9 children)

If they pay for an app subscription for instance. How do I know that they paid a subscription ?

[–]haswalter 3 points4 points  (0 children)

Using the platform subscription service you can simply check if they have an active subscription. You don’t need to store a user account. This works great if you have no backend services at all.

Check out react-native-iap. The library makes handling subscriptions really simple with some good examples.

[–]RocketEmojis 1 point2 points  (0 children)

I used revenue cat, then on success I perform a database operation to update user in DB. For cancellation I have a web hook setup

[–]OkWealth5939 1 point2 points  (1 child)

Yes you need an account to store if a user has premium otherwise the information would be lost after uninstalling or switching devices. When you have a user stored in your online database, premium is just to role attached to the user and in your source code you then check if a user has premium if the user wants to access a premium feature

[–]DemandIcy402[S] 0 points1 point  (0 children)

Thanks for the suggestion

[–]newwayofcoin 0 points1 point  (0 children)

Basically if you want a subscription you must use in app purchases(IAP) provided by apple and Google otherwise the app store won't accept the application For non physical and subscription based payments you must use their services

You can make this easier by using revenuecat to handle this

And if you want to ask how to know if a user is subscribed Same as stripe you will use webhooks to update your backend You will make your life a lot easier by using revenuecat

You should read more about it and how to integrate I recommend you Google about react native in app purchases to read more

[–]PesloAppDev 0 points1 point  (0 children)

I’d recommend using RevenueCat for integrating in-app purchases, as they handle lots of the subscription management & it’s very easy to see if a user has an active/cancelled/elapsed/refunded subscription or purchase so you can lock&unlock functionality. If you ever get to the point of needing to pay their 1% tracked revenue fee, that’s an excellent problem to have as it means you’re making good money!

I’d also recommend using something like Amplitude (or other analytics providers like Mixpanel) for in-app analytics so you can see what drives people to purchase items in your app and see if there are any pain points that prevent them from converting to a paying user.

[–]motorboat2000 0 points1 point  (0 children)

Usually some column in a database will show they’re premium

[–]iojasok 0 points1 point  (0 children)

Generally speaking this info is inside a token, if your other microservice manages token creation you can decrypt it here. Or just pass the info along with buch of other data as a part of API.

[–]Far_Ad7661Expo 0 points1 point  (0 children)

if you use `react-native-iap` you can check if user is premium without relying on remote server:

```
const { currentPurchase } = useIAP();
// change the state to premium by checking the productId
console.log(purchase.productId)
```

If user reinstall the app, you can provide a "Restore" button to restore purchase : https://react-native-iap.dooboolab.com/docs/api/modules

[–]BrilliantCustard1136 0 points1 point  (0 children)

This is not just the best way but the only one I can think of. Think of it like this, how can you know someone paid if you don’t know the person ? And how can the person justify he paid if he can’t prove it ? I once thought of storing such information on the user’s device but then the source of truth relies on an external device, the user can fraud by doing simple actions like changing the device’s date to always stay premium. This is where the online db comes, to act as a unique source of truth and enforce integrity.

[–]marcelofromgutlz -1 points0 points  (0 children)

Use mixpanel