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



Handling upgrade and downgrade for same group

Hello Team, I am testing the subscription products using sandbox. I have below four auto renewable subscription products in one group in order of SLAs. I have read the blog post about subscriptions group. Elite Yearly Elite Monthly Premium Yearly Premium Monthly I want to allow user to purchase only one of the four subscriptions so do not have two subscription groups. I have tested purchasing individual products and it is a breeze with RevenueCat so thanks. Scenario i was testing is, I purchased Premium Yearly and then purchased Elite Monthly before first renewal of Premium Yearly. iOS shows a dialog as "Your upgrade will start now. You will receive refund ..." When I tried to process purchaserInfo, it showed both products as active. See below. Is this how it will also behave in production? i have below queries. 1. if upgrade is done immediately then till when will purchaserInfo keep showing both as active products? 2. I have to save Elite Monthly as upgraded product in my app immediately and apply business rules, right? So how do i pick the new active product? Even the expiresDate for activeEntitlements is for Premium Yearly. 3. In case of downgrade (say Elite Yearly to Premium Monthly), will purchaserInfo show Premium Monthly product after subscription period is over for Elite Yearly? When i tried testing this, iOS prompted me to cancel from settings but it doesnt work for sandbox test user so do i have to wait for one hour till first renewal happens at which point purchaserInfo will show only premium monthly as active product? Sample purchaserInfo for upgrade scenario for Premium Yearly to Elite Monthly <PurchaserInfo originalApplicationVersion: 1.0, latestExpirationDate: 2019-08-25 09:59:37 +0000 activeEntitlements: { "premium_entitlement" = { expiresDate = "2019-08-25 09:59:37 +0000"; }; }, activeSubscriptions: { "" = { expiresDate = "2019-08-25 09:44:02 +0000"; }; "" = { expiresDate = "2019-08-25 09:59:37 +0000"; }; }, nonConsumablePurchases: {( )}, requestDate: 2019-08-25 09:39:07 +0000 > Thanks Ashish

Posted by Ashish Naik 7 months ago


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 ( === '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 8 months ago