osx - macOS auto-renewing subscription: how to handle expiration properly? -




i have premium feature unlock implemented auto-renewed subscription in-app-purchase on macos. able test of correctly in macos sandboxed application: validate receipt locally, , parse receipt in-app-purchases. of iaps, can determine expiration time.

what struggle if current time past expiration time.

if time has passed, can mean following:

1) system auto-renewed subscription app doesn't know yet. code should "soon" getting called via callback registered @ launch time transactions in pending queue, telling me renewal. point can parse receipt again , enable premium features if needed.

or

2) there no auto-renew (the user cancelled, apple wasn't able charge user, etc). won't call it.

then question is: if detect expiration @ launch time, user experience supposed be? how long wait call back?

the thing can think of doing putting kind of dialog "checking subscription..." few seconds. , after timeout, if didn't update via callback, assume subscription didn't auto-renew (for whatever reason). can tell user go "non premium" mode.

that user experience isn't horrible, want allow user renew app: may realize forgot change credit card info, or other reason let lapse, i'd ability let them purchase subscription again app, did first time.

if follow logic , let them renew app, don't call in app when purchase completes. apple specifies if app running, won't call back:

note if app running when subscription renews, transaction observer not called; app finds out renewal next time it’s launched.

...and indeed, in testing (in sandbox) i'm not getting called. how supposed know can turn premium feature on?

i can't refresh receipt periodically since i'm on macos (it's supposed work on ios), , can't "restore purchases" until see update either, because of side effects in transaction logs (it multiplies transactions).

do brutally exit? (poor user experience, , when right time exit?)

what proper way handle this?





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -