Skip to main content
Answer

if (purchaserInfo.entitlements[XXXXXXXXX]?.isActive == true) {} Not working

  • March 13, 2022
  • 3 replies
  • 1005 views

Forum|alt.badge.img+6

I have found testing that the line below sometimes returns false when a subscription is active. 

purchaserInfo.entitlements[XXXXXXXXX]?.isActive

How can this be?

Also I notice that in your quick start guide you no longer have the line purchaserInfo.entitlements[XXXXXXXXX]?.isActive

regards

Peter

 

Best answer by sundeep

Hi @Peter Rule,

It looks like you asked this question in a separate thread, so I answered you there: 

 

This post has been closed for comments

3 replies

Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • March 14, 2022

I have done more testing and it appears that 

Purchases.sharedInstance.getPurchaserInfoWith

is unreliable.

During an active subscription the entitlement status returned changes.

purchaserInfo.entitlements[RC_ENTITLEMENT_NO_ADS]?.isActive is true sometimes but at other times it is false.

I am testing a monthly subscription on a phone with Android 9.

Please advise


Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • March 14, 2022

I can answer my own question.

I should have looked the customer history. The testers seem to always have their subscription cancelled due to a billing error.  It didn’t occur to me that this could happen with a tester account.

Why are are billing issues happening with a tester account? Android always seem to fail and the one iOS sandbox tester had a billing issue but auto re tried and succeeded.

Can someone explain?


sundeep
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • Answer
  • March 22, 2022

Hi @Peter Rule,

It looks like you asked this question in a separate thread, so I answered you there: