Implement proactive in-app purchase restore

RSS for tag

Discuss the WWDC22 Session Implement proactive in-app purchase restore

Posts under wwdc2022-110404 tag

2 Posts
Sort by:
Post not yet marked as solved
2 Replies
984 Views
Hello everyone, I am writing to inquire about a strange behavior that I encountered while using StoreKit 2 on watchOS 9.1 and Xcode 14.2. Specifically, when using the Transaction.currentEntitlements method, it returns refunded non-consumable purchases alongside valid ones. Additionally, I have observed that Transaction.updates does not notify me of refunded purchases or cancelled subscriptions while testing on my local environment with Xcode. When implementing the same code with an iOS app, it works as expected, indicating that this may be a watchOS-specific issue. This behavior is unexpected, and I am unsure if this issue also occurs in a production environment. Can anyone please help me with this issue? Thank you in advance.
Posted Last updated
.
Post marked as solved
6 Replies
2.4k Views
I'm following the example code that comes with SKDemo to understand where in the lifecycle of my app to detect the subscription has expired to block users from having access to functionality they shouldn't have access to anymore. This is pretty straight forward to implement and check on app launch. However, my app has a pretty low memory footprint so it's often not getting terminated over the course of several days. Still, I would like to check for a valid subscription whenever the app is foregrounded. Otherwise users might have access to subscriber-only features for numerous days before the app finally has to cold start again. Is there a way to listen to these kind of 'subscription-expired' updates or do I need to figure out myself to verify the subscription, for instance, by listening to UIApplication.willEnterForegroundNotification and then run some business logic on my end to confirm the user is still within the subscription period?
Posted
by kersten83.
Last updated
.