agisboye / app-store-server-api

A Node.js client for the App Store Server API
MIT License
210 stars 32 forks source link

Not clear how we detect if subscription is active? #21

Closed ollyde closed 1 year ago

ollyde commented 1 year ago

Thanks for this great library, saved me a ton of time!

But; would be nice if we had a short explanation on how we actually know if the user has subscribed or not?

if (renewalInfo.autoRenewStatus == AutoRenewStatus.Off) {

The following code always returns "Off" even though they are still subscribed (although Sandbox)?

agisboye commented 1 year ago

Hi Oliver,

The auto-renew status tells you whether the user's subscription is going to renew at the end of the subscription period. To check whether the user is subscribed right now you should look at the expiry date and the revocation date (which is present if the subscription purchase was refunded by Apple). I'd suggest you refer to Apple's documentation: https://developer.apple.com/app-store/subscriptions/

ollyde commented 1 year ago

@agisboye indeed, perhaps the readme could use a short sentence.