My macOS app offers non-renewing subscriptions which last for a month. This is long enough that if I change my system clock to test whether the app detects the expiration of the subscription correctly, StoreKit fails to obtain the products available for sale. I would like a way for my app to know it is in the sandbox so it may shorten the subscription durations in the sandbox only, similar to how auto-renewing subscriptions are handled automatically.
- These are non-renewing subscriptions, so the sandbox environment doesn't know how long they are supossed to last and can't change their duration automatically for testing as it does for auto-renewing subscriptions. (Despite the fact that AppReview literally called me on the phone and told me it does; there is no place in the appstoreconnect UI to add a duration for a non-renewing subscription.)
- I would like the method to work for AppReview as well, so merely doing a custom build which has the subscription duration shortened by build setting, environment variable or command line argument won't suffice.
- My users expect this app to work reliably without a reliable internet conneciton. It's already an imposition to ask them to get internet access for making purchases for renewals, but I need the app to know when a subscription has expired without internet access. Thus, I don't think I'm able to post to the store network endpoint that can directly tell me if it's sandbox.