bizz84 / bizz84/SwiftyStoreKit
Auto-renewable subscriptions optimal implementation & experience. fetchReceipt with a forced refresh - when is it needed?
- Dominant language
- Swift
- Stars
- 6.7k
- Forks
- 801
- PR merge metrics
- No merged PRs in 30d
Description
### Platform
- [X] iOS
- [ ] macOS
- [ ] tvOS
### In app purchase type
- [ ] Consumable
- [ ] Non-consumable
- [X] Auto-Renewable Subscription
- [ ] Non-Renewing Subscription
### Environment
- [X] Sandbox
- [X] Production
### Version
Latest
### Related issues
-
## Report
### Issue summary
I haven't found an exact issue here, although I do see related questions floating around a lot.
I was wondering what is the optimal implementation and flow for auto-renewal subscriptions and handling their expiration date, assuming the validation is done on the app side.
Should the app keep the expiration date stored locally eg in the keychain and periodically call fetchReceipt and verifyReceipt ? When is a forced refresh of the receipts required? This call triggers a iTunes login popup so obviously it should be avoided whenever possible. Once the subscription auto-renews, will the fetchReceipt method (if not forced) return the renewed, recent receipt or the original, now expired receipt? In general, how would you imagine the perfect flow that has the best user experience and at the same time controls the expiration time correctly?
Thank you for an amazing library!
Contributor guide
Assessment
This issue has not been assessed yet.