Solved

Need help debugging inactive entitlement on purchase success


Userlevel 1
Badge +9

try {
...
final PurchaserInfo info =
await Purchases.purchasePackage(package);

if (info.entitlements.all.containsKey('plus') && info.entitlements.all['plus']!.isActive) {
// amplitude logging for new subscription
// show toast to user to indicate success
}
} on PlatformException catch (e) {
...
}

We are using Flutter and support purchasing subscriptions (‘plus’ entitlement) and we noticed that our manual logging seems to be heavily undercounting the number of new subscriptions we get compared to RevenueCat’s dashes.

We verified that the entitlement and products are defined properly. Our understanding is that if the purchase succeeds, then PurchaserInfo should always have the ‘plus’ entitlement active. Are there cases where it’s expected for the entitlement to be inactive when the purchase succeeds? Or is there something else we can do to debug?

 

 

icon

Best answer by sharif 29 July 2021, 22:53

View original

10 replies

Userlevel 5
Badge +9

Hello Steph,

We have sent this post into our ticketing system, where our Support team will handle your request.

Userlevel 1
Badge +9

@sharif to clarify, is someone from the support team supposed to reach out to us? Not sure if we missed something!

Userlevel 5
Badge +9

Sorry for the trouble! We tried to reach out to you a couple of weeks ago, maybe the email went to spam? We’ve been having some issues where our support tickets get filtered by some spam filters. If you just create a support ticket from your account settings we’ll be able to continue the support thread over email.

Userlevel 1
Badge +9

I don’t seem to have any emails in spam. I did receive an email confirming a ticket was made but there wasn’t any questions/status updates via email. Is it possible to reach out to my email again?

 

 

Userlevel 3
Badge +8

Hey @Steph!

Sorry for the confusion about this. I sent you another reply in Zendesk with my follow-up questions - let us know if you still have trouble seeing or receiving replies.

Badge +3

Hey @sundeep. I have the same exact issue in my react-native application, what was the problem and its solution?

Userlevel 1
Badge +9

@Ahmed The conclusion was we can't rely on our own logging of these events and the revcat amplitude integration should be more reliable for event tracking. Pasting RevCat’s email response:

 

 

Looking at your code, it appears you're doing your own custom logging based on the success of purchaseProduct().

You might be seeing undercounting because some transactions don't necessarily complete during the initial flow to purchase. This could be for various reasons. For example, if there's a STORE_PROBLEM error, the transactions stay on the payment queue and RevenueCat attempts to finish them the next time the app launches. Another example would be if the user makes the purchase in the App Store directly (they wouldn't go through your flow).

There are a lot of similar edge cases that RevenueCat handles in order to capture an accurate amount of purchases. For this reason it might be better to either perform this logging on your backend (by listening for INITIAL_PURCHASE webhook events), or relying on how these events are captured in RevenueCat's Amplitude integration (since you seem to have that set up). This should help get a more accurate count.

In general, though, it's common to see some data discrepancy even with integrations, because they rely on events whereas RevenueCat relies on the receipt itself: https://community.revenuecat.com/featured-articles-55/about-data-discrepancies-116 

Badge +3

Hey, thanks for the response @Steph. Regardless of the logging, did you end up fixing the purchase succeeding but no entitlement being given? I seem to be having this issue quite frequently in TestFlight/ on my development client. 

Userlevel 1
Badge +9

@Ahmed our TestFlight actually always works fine (but our dev client is messed up for other reasons 😅). My guess is there is probably a different issue from my original issue so maybe something else is wrong (e.g., entitlements/product setup).

Badge +3

@Ahmed our TestFlight actually always works fine (but our dev client is messed up for other reasons 😅). My guess is there is probably a different issue from my original issue so maybe something else is wrong (e.g., entitlements/product setup).

Thanks Steph, I really appreciate the response. I’ll look into it more.

Reply