Skip to main content

I am currently implementing my subscriptions for android and ios using cordova-plugin-purchases (4.2.3).

I want to use subscriptions which are non renewing.
F.e. user buys “premium access” for 1 year. After 1 year the subscription expires (and does not renew) and the entitlement should be removed.

So far so good. In Google Play I can configure this. I link the product in revenuecat, I buy it, I get the entitlement, after the period the entitlement is removed. Fine!

I assumed I can do the same in Apples Appstoreconnect. There is the option to create a subscription without auto renew. So I created one, I link it in revenuecat. I create an offer. It is visible in my offers on my iphone.

But two things happening:

  • I cannot set a duration for the subscription in App Store Connect (seems pretty odd to me for a subscription product. Isn´t it then just a consumable / one time purchase?)
  • I get an error from RC cordova SDK:
    • “DEBUG: Couldn’t decode ‘PeriodType’ from json.
      Error: Found unexpected value ‘prepaid’ for type ‘PeriodType’
    • ​​​​​​​​​​​​​​And yes, thats a good point. As mentioned above I couldn´t even config a period / duration.

I find nothing in RC docs and (barley) nothing in community forum either regarding this topic. Just someone here telling that Apple does not provide a duration for those: https://stackoverflow.com/questions/39527660/configure-duration-of-non-renewing-subscription which is kind of ridiculous for a subscription IMO. 

But what is to do now?

How can we use non renewable subscriptions for IOS in Revenuecat?

When its my task to handle the duration and expiration, how and where its done?

Or should I just not use those but the classic renewable ones?

Thanks in advance for your help.

Hi, for non-renewable subscriptions, the duration is not managed by Apple/StoreKit so you’ll need to manage this yourself. Non-renewable subscription purchases are validated and tracked with RevenueCat, but it does require you to handle the expiration of this.

 

To use these with RevenueCat, you'd create a non-subscription purchase and you should not attach to an entitlement, because RevenueCat would treat it as a permanent entitlement since we don't receive an expiration date from Apple for these. You would need to set up your own system to handle expiration and granting/revoking access. You could get the purchase date from CustomerInfo or our GET /subscribers endpoint and use that to determine whether the user has access. Additionally, you could store this information inside a custom subscriber attribute and store the expiration date in it.


Okay, got this so far.

So it could be a solution to just not assign the purchases to an entitlement.

And then I can just check all “purchases” in “CustomerInfo” and then decide myself in my app if I provide some functionality or not. Dependent on the purchase date and my own “duration” I want to grant.

What I am still just wondering is why I got this error for the non renewable product?

DEBUG: Couldn’t decode ‘PeriodType’ from json.
Error: Found unexpected value ‘prepaid’ for type ‘PeriodType’

This should not happen if its supported, no?


Can you upgrade the SDK to 4.8.0 and let me know if this fixes it? You are on an older version so we may have fixed this bug: https://github.com/RevenueCat/cordova-plugin-purchases/releases/tag/4.8.0


Reply