I have been following these resources to set up auto-renewable subscriptions in my app written in SwiftUI
:
- What's new in StoreKit (WWDC17)
- Advanced StoreKit (WWDC17)
- https://blckbirds.com/post/how-to-use-in-app-purchases-in-swiftui-apps/
I basically have a class that implements SKProductsRequestDelegate
instantiated in SubscribeView
that processes the transactions. I was able to complete the entire flow in Sandbox (got the receipt and the server notification, created a corresponding subscription entry in my database).
The response coming from the verifyReceipt
endpoint is quite complex and I am not sure if I understand it correctly. I am looking for an easy solution to get the latest subscription state. I don't want to focus on churn rate or anything else now.
Questions:
-
Does on-device receipt get automatically modified when the user cancels or modifies the subscriptions or when the trial period ends? If yes, can I rely on resubmitting the latest receipt from the device to my backend in order to keep track of the latest subscription state? I could resubmit the latest receipt on app startup, the server would verify and possibly update the subscription.
-
In the Advanced StoreKit (WWDC17) talk, it is mentioned to implement
SKProductsRequestDelegate
as soon as possible (e.g. in theAppDelegate
). Do I even need that if I already have that delegate implemented in theSubscribeView
? If I understood correctly, the purpose of that would be to be notified of the transactions done after some time (subscription change, cancellation, entering grace period, etc.). I'd prefer to ignore these for now and just rely on resubmitting the latest receipt to check the current subscription.