RevenueCat

Build With RevenueCat

Build a customized mobile subscription business with RevenueCat. We do the heavy lifting of normalizing subscribers from any source and maintain a single source of truth for subscription status, so you can get back to building your app.

RevenueCat is a powerful, secure, reliable, and free to use in-app purchase server with global support. All you need to get started is an API key.

Ask A Question

Questions

1

Could it be that Purchases.identify does not work sometimes?

Hey, we are using react-native-purchases for an iOS app. We call the setup method when the app starts, and as soon as the user hits the buy-button, we identify the user and perform the purchase. We need the identify with OUR user-id to make sense of the incoming webhooks. This works 95% of the time, but sometimes the identify-call does not seem to have worked, since OUR user-id is not in the aliases of the related webhooks. We have lots of precautions in place. - We check that OUR user-id is there and well-formed before we call identify. - we check if the user has wifi or cellular connection before calling identify.. - ..and also before making the purchase Here is an excerpt from our code:(javascript) ``` // ...this is inside an async function const connectionInfo = await NetInfo.getConnectionInfo(); if (connectionInfo.type == 'wifi' || connectionInfo.type == 'cellular') { // perform purchase, we have a connection // sometimes this does not work... await Purchases.identify(userId); const entitlements = await Purchases.getEntitlements(); if (websiteEvent.name === 'purchase12Plan') { this.performPurchase('12months', userId, entitlements); } } // .... performPurchase = async (durationString, userId, entitlements) => { try { const purchaseMade = await Purchases.makePurchase( entitlements.premium[durationString].identifier ); if ( purchaseMade.purchaserInfo.activeEntitlements !== 'undefined' && purchaseMade.purchaserInfo.activeEntitlements.includes('premium') ) { // Unlock that great "pro" content this.props.navigation.navigate('Loading'); } } catch (e) { if (!e.userCancelled) { console.log(e); } } ``` Do you have any hint why identify sometimes fails to set the new user id? We are running out of ideas what the cause could be.

Posted by Thomas Ranker 9 days ago

5

Get Trial info when calling getEntitlements (react native)

Hi, Where do I get the details about the trial period of a product? In the debug logs I see the details: sub_base_year_7dt_0dis_4499 - SkuDetails: {"skuDetailsToken":"AEuhp4KzyAa_7DAhCzFKHEQ8IF-QpG78EOeeLPk0svSArQOHVWcIETZINK77vgg0vu_x","productId":"sub_base_year_7dt_0dis_4499","type":"subs","price":"₪149.90","price_amount_micros":149900000,"price_currency_code":"ILS","subscriptionPeriod":"P1Y","freeTrialPeriod":"P1W","title":"1 Year Premium Membership (STG - Dynamo Parents)","description":"Give your kid 1 year of fun education"} When calling getEntitlements, I am getting the following response (in Android): ... "annual_with_trial": { "currency_code": "ILS", "intro_price_string": "", "intro_price_cycles": "", "intro_price_period_number_of_units": "", "price_string": "₪149.90", "intro_price_period": "", "intro_price": "", "price": 149.9, "title": "1 Year Premium Membership (STG - Dynamo Parents)", "intro_price_period_unit": "", "description": "Give your kid 1 year of fun education", "identifier": "sub_base_year_7dt_0dis_4499" }, What am I missing? btw, in iOS (I know its a different product as its from the app store, and still, response in React native) I am getting more info: “annual_with_trial”: { “description”: “Give your kid 1 year of fun education”, “price_string”: “₪159.90”, “intro_price_period_unit”: “WEEK”, “currency_code”: “ILS”, “title”: “1 Year Premium Membership”, “price”: 159.89999389648438, “intro_price”: 0, “identifier”: “sub_base_year_7dt_0dis_4499”, “intro_price_period_number_of_units”: 1, “intro_price_period”: “P1Y”, “intro_price_string”: “₪0.00", “intro_price_cycles”: 1 }, Thx

Posted by orr kowarsky 16 days ago

0

Legacy in app purchases and users without accounts.

Hi! I am using RevenueCat in the Android beta version of my app with great success. Thank you for such a great product! For the Android app it was super easy since it had accounts and subscriptions from the start. Now it is time to add RevenueCat to iOS too and here it is a little more complicated since it started as a paid app, then was a free app with a one time in app purchase and now moving to subscriptions. I have the following rules for the purchase 1: IOS users that purchased the app when it was a paid app should remain unlocked on iOS by checking the originalpurchase version 2: IOS users that purchased the one time in app purchase should stay unlocked on iOS, and get a special offer if the switch to Android 3: Subscribers should be able to access premium featrues on both platforms if they are signed in If a user is not signed in the user is asigned an anonymous id. I use firebase authentication and followed your example with the auth state listener and resetting purchases when signing out. The problem I have is that it also removes the originalpurchase version from purchaser info, so if a user that has purchased the iOS or unlocked the one time in app purchase uses an account and then signs out, it will loose the in app purchases. As I see it there are two possible solutions. 1: If the singed in user had premium access, restore purchases after sign out is completed. 2: Keep the legacy in app receipt validation and use that to validate the paid/one time fees. Which one would you recommend? I'd love to go with 1 since it removes the need for having multiple restore variants. Are there any downsides I should be aware of?

Posted by Simon about a month ago