Relative Content

Tag Archive for iosswiftuiin-app-purchasesubscriptionstorekit

StoreKit 2: .subscriptionStatusTask lag and how to display a ProgressView in the interim?

I am currently using .subscriptionStatusTask on the main view for my app. Everything seems to be working pretty well so far with my testing in Xcode. However, when I popped this over to TestFlight, I notice that I’m getting some “lag” between once I “buy” a subscription and when .subscriptionStatusTask kicks off after it notices the change. In other words, it takes a few seconds before my app knows that it’s the “Pro” version and not the initial non-subscription version (I set a published variable indicating pro or not pro). So my questions are:

StoreKit 2: How to use .subscriptionStatusTask modifier to know which subscription in a subscription group is purchased/active?

I have another question about auto-renewable subscriptions. I am currently trying to implement In-App purchase subscription choices (one monthly and one yearly; both are in the same subscription group) to my app using SubscriptionStoreView and the modifiers .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionSheet. I do NOT offer any other type of In-App purchases and will not be in the future.

StoreKit 2 In-App Purchase – How to test with sandbox id using TestFlight?

I am currently trying to add auto-renewable In-App purchase subscription choices (one monthly and one yearly) to my app using SubscriptionStoreView and the modifiers .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionsSheet. I know that I can test this via Xcode with the .storeKit configuration file and that seems to be going pretty well. However, I would like to be able to test via TestFlight also. There are several Apple Developer Forum posts that seem to indicate that this is possible by setting up a sandbox user id in App Store Connect and then going to Settings -> App Store -> Sandbox Account (on my phone) and entering that sandbox user id that I just set up. Some posts suggest that this is presumably so that TestFlight will use that sandbox id when my app is running and not my personal user account when trying to buy subscriptions.