Post

Replies

Boosts

Views

Activity

Detect a subscription has expired
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?
6
0
2.7k
Oct ’22
Implement "traditional" in-app purchase restore
I love how flexible yet simple the StoreKit2 APIs work. With the help of the session video and the provided example code, Implementing pro-active in-app purchase has been relatively straightforward. Now I wonder, does Apple require me to add a button - Restore Purchases - to the set of in-app purchase options in my app at all? If the answer is yes, is there any best practice on how to implement the "traditional" way of restoring in-app purchases with StoreKit2?
1
0
757
Sep ’22
[Apple Watch Connectivity Demo App] Application context only received on phone
I'm currently learning how to use WatchConnectivity to send data from the iPhone companion app to the Watch extension. I watched the talk "Introducing Watch Connectivity" from WWDC 2015 and downloaded the example project provided by Apple which demonstrates the different WC capabilities. For my specific use case I'm particularly interested in updating the application context on the phone and receiving it on the watch. When I launch the demo app on the phone/watch simulator I see a "Update App Context" button in both UIs. My understanding is that pressing this button for instance on the phone will call the session's delegate callback didReceiveApplicationContext on the watch on the next app launch. While this works as expected the other way round, meaning pressing the button on the watch first and receiving the application context on the phone on app launch, I can't get it to work with the context being sent from the phone to the watch. The breakpoint in didReceiveApplicationContext is never hit. I also noticed that when I set a breakpoint in activationDidCompleteWith on the watch the session property paired and watchAppInstalled are set to false: However both of these properties are true on the phone: I did not touch any of the code in the demo app, just set breakpoints to understand what's going on. My question is: Is it possible to update the application context in both directions?
1
0
1.5k
Jul ’21