I would like to implement in-app auto-renewing subscriptions to open up "Pro" options for my app if a user chooses to subscribe. The user would be able to choose from a monthly or yearly subscription version. I have looked at hours and hours of countless videos, documents, tutorials, Apple examples (Backyard Birds, etc.), and posts on all of this but I'm still not sure that I understand the correct way to do this via the "new" StoreKit 2 framework additions. From various WWDC videos, it would seem that it's now as simple as using SubscriptionStoreView and then utilizing the modifiers .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionsSheet. It sounded to me like everything, including purchases and verifying transactions, is handled automatically for auto-renewing subscriptions. When testing my app, I can bring up my store view with no problem and make purchases with the simulator. That being said however, I am finding it fairly difficult to understand exactly what I need to do in order to make this all work correctly. The following are questions that I need answered in order to proceed:
For in-app auto renewable subscriptions, should we just be using: SubscriptionStoreView, .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionSheet?
Does .subscriptionStatusTask automatically and continually check for subscription status changes so that views dependent on that status will know whether or not a user has a valid subscription?
Do I also need to set up a task when opening my app that checks for current entitlements?
Do I still need to explicitly verify transactions or devices?
What is supposed to happen with the logic flow? Is it suppose to be:
Check to see if user EVER had a subscription...
---- if NOT ->
present the paywall/store
---- else ->
present the manageSubscriptionSheet
Note: When I've tested variations of this, if the user didn't have a previous subscription at some point, the manageSubscriptionSheet will not be presented. It just "clocks" with a blank screen.
Sorry for so many questions. I submitted a code-level support request to get help with this but the email I received back said to just post in the forum. I'm hoping someone here can help. I have other questions also but I'll make a separate post for them. TIA.
Post
Replies
Boosts
Views
Activity
My App sets up multiple local notifications via a loop based on a calendar date and time (calendar trigger). While everything else is working correctly with this, I cannot seem to get the badge number to increment properly. I tried setting this up via content.badge but what happens is...
User gets notification 1,2,3,4,5 and badge number gets set to 5 content.badge = self.counter
User then "clears" notifications 2 and 3 - and badge number is now 3 via my code (UIApplication.shared.applicationIconBadgeNumber - 1)
When the next notification (number 6) pops up, the badge number SHOULD show 4. It doesn't. It shows 6 because that's what was set via content.badge
What is the proper way to increment the badge number? I've looked at various posts here but they're for push notifications. Mine is for a local notifications. Can I set/update badge number WHEN a notification is actually delivered? ...Or does notification manager somehow handle this automatically?