StoreKit Test

RSS for tag

Create and automate tests in Xcode for your app's submission and in-app purchase transactions.

StoreKit Test Documentation

Posts under StoreKit Test tag

54 Posts
Sort by:
Post not yet marked as solved
1 Replies
300 Views
Hi, We are trying to test Auto-Renewable In App Purchases in our iOS application and we need to support several use cases: Grace Period; Failed Transactions; Cancel the Subscription. Regarding Cancel the Subscription, we know this is possible to test in Sandbox environment, as we can intentionally cancel it (since iOS 14), and the Auto-Renewable finishes the renewal operations after some times. The problem we have is: to test the use case where we couldn't renew the subscription (failed transaction) and we want to continue offering the service during the Grace Period. We were not able to reach this scenario neither in Sandbox environment nor using StoreKit in Xcode Debug mode. Does anyone have a way to test this use case we described? Is it even possible to test this particular use case? Thank you!
Posted
by
Post not yet marked as solved
1 Replies
238 Views
I have a black screen on the Simulator on xcode. i added all the code on the [App title] not the ContentView. do I have to code the ContentView to make the app work? if so what do I need to add?
Posted
by
Post marked as solved
1 Replies
358 Views
For implementing a Store functionalities and tests by using StoreKit2, I have a task listener and two testcases. The first one is waiting the update notification before processing the next SKTestSession operation.The second one is not waiting the update. I looked update events theree times on first one, and twice on second one. My question is, "Do multiple transactions created or modified within a certain period be emitted as a single Transaction.updates event?" Task listener Testcase1 Testcase2
Posted
by
Post not yet marked as solved
1 Replies
218 Views
Hi, i would like to ask if there is a good way to build or setup an app with a lite version and premium version. Can't look up for good tutorials or ideas.
Posted
by
Post not yet marked as solved
1 Replies
334 Views
I have created the in-app purchase demo using store-kit before 1 year and also validate receipt. for that time it's working fine.now I purchased product and i am getting receipt validation status code is "21002". Can you please let me know how can i solve? Thank you!
Posted
by
Post not yet marked as solved
2 Replies
344 Views
Hi, My app in-app purchase downloading from TestFlight or debug Xcode making purchase works correctly but it reject in apple review because during the test purchase didn’t work and occurred error:SKErrorDomain with code 2. This error in general appear when during the purchase user click Cancel. I have contacted apple board, they said that Your app does not comply with App Store Review Guideline 2.1. So how can i try in production since in TestFlight and debug it works? I really confused how to try solution for it?
Posted
by
Post marked as solved
1 Replies
407 Views
Hi All, I am using x code Version 12.5.1 (12E507) I make application using flutter I build IOS success and run on simulator is ok, every thing is fine but in Xcode I face the problem, Failed to create provisioning profile. There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it. No profiles for 'com.company.myapp' were found Xcode couldn't find any iOS App Development provisioning profiles matching 'com.company.myapp'. also if I try to change I get Failed to register bundle identifier The app identifier "com.example.myapp2" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again. in store connect I create com.company.myapp but also failed to avoid message I need to upload my apps using xcode I have company account, not free account please help
Posted
by
Post not yet marked as solved
1 Replies
435 Views
When we request the current entitlements for a user using the Transaction.currentEntitlements static method, does StoreKit provide transactions for subscriptions with a Product.SubscriptionInfo.RenewalState set to .inGracePeriod or only .subscribed? I'm asking because as a developer we need to give access to content to a user if its subscription is in .inGracePeriod. So in my opinion, the user is still entitled to this subscription. I've not found any information in the documentation, WWDC videos or Apple sample codes. The documentation explains The latest transaction for each active auto-renewable subscription Is .inGracePeriod considered an active subscription?
Posted
by
Post not yet marked as solved
4 Replies
968 Views
When dealing with auto-renewable subscriptions, there are multiple ways to access the latest transaction. We can access it when a purchase is made, or we can request the latest transaction for a given productID at a later time. To do so, we can use Transaction.latest(for:), access the transaction history using Transaction.all, get the currentEntitlements, or use the array of Product.SubscriptionInfo.Statusthan contains the latest transaction for a subscription group. It's also necessary to listen to transactions when the app is running using the AsyncSequenceTransaction.updates`. In my app (and also in the SKDemo project from Apple), when I want to access the latest transaction as soon as the app is launched, it's missing the transactions that renewed or happened while the app was not running. I tried using the different methods mentioned above but they never give me the latest transaction, always the latest transaction while the app was running before I killed it. I have to wait for a new renewal event to receive the latest transaction in the Transaction.updates listener, which is not good. For example, when I set the Subscription Renewal Rate to Monthly Renewal Every 30 seconds, and I quit the app when the latest transactionId is 100, I wait for 5 minutes, I expect to see the transactionId 110 but I see 100. In the real life, it means that if the app is not running when a monthly or annual subscription renews, I have to wait weeks or months to receive the missing transaction. I thought that the Transaction.updates listener would be called at launch with all the transactions that occurred while the app was not running. Is that a bug in Xcode or have I misunderstood something? How can I access the real latest transaction that happened when the app was not running at launch? I need to access that to know what the user has access to. I think the transaction management panel from Xcode displays all the transactions, even the one when the app was not running. PS: I'm using Xcode 13.2.1 and iOS 15.0 (simulator). Transaction.updates is not working on iOS 15.2 (my device, or simulator) from what I've seen so far.
Posted
by
Post not yet marked as solved
2 Replies
518 Views
I'm not a member of any Family in iCloud. I want to understand what happens when a user is subscribed through Family Sharing but also how to use StoreKit when the user is subscribed twice: as an individual who purchased the product and as a member of a family when the purchase is shared with him. How can I test Family Sharing for an app offering a product with Family Sharing enabled? Is it possible to create a fake Family in App Store Connect and add testers to it?
Posted
by
Post marked as solved
1 Replies
401 Views
Let's imagine an app with two plans, one for individual (level of service 2) and one for family (level of service 1). If a user is subscribed as an individual, but if someone in his family shares a family plan with him, will Transaction.currentEntitlements show both subscriptions? Or only the transaction where the user is the owner (in this case the individual subscription)?
Posted
by
Post not yet marked as solved
2 Replies
535 Views
Hello, When a user cancels a subscription during a free trial, we should stop providing access to content. How can we know that? From the in app management in Xcode, when I cancel a subscription during free trial period (cancelling in the few seconds after the purchase), the currentEntitlements still provide the subscription. How to know when a user cancelled the subscription during free trial? Thanks
Posted
by
Post not yet marked as solved
1 Replies
430 Views
Hello, I want to access the latest transaction for a Subscription Group. I use the following method static func status(for groupID: String) async throws -> [Product.SubscriptionInfo.Status] to access the statuses for the group, and from there, I can get a verified transaction from the status. But when I set the GroupID equal to the Subscription Group Reference Name I put in the .storekit configuration file in Xcode, I don't have any status (so wrong ID). Actually, I have to use a subscriptionGroupID like 3F19ED53 (found using a previous transaction: https://developer.apple.com/documentation/storekit/transaction/3749718-subscriptiongroupid). When I look into a Product, this ID is set for subscriptionFamilyId. So my question is how can I know the ID if it's not the one I provided in App Store Connect or the config file? Do I first have to access a Product from this group? Thanks.
Posted
by
Post not yet marked as solved
1 Replies
278 Views
I use StoreKit test in Xcode to test Consumable Project. I want to test the refund of Consumable Project. When I open the Manage StoreKit Transactions of Xcode 13, when I select Non-Consumable Project, I click the Refund Purchases button to purchase There is no refund for items, but when I click on the Consumable Project, I cannot refund. I test the refund function of Consumable Project. We know that the relevant document is 'https://developer.apple.com/documentation/appstoreservernotifications/responsebody', but we don’t know how to trigger a refund in a sandbox environment
Posted
by
Post not yet marked as solved
0 Replies
314 Views
I feel like this might be a bug with how Mac apps use StoreKit Configuration and the Transaction Manager. I've got a Catalyst app that, while testing, will not call paymentQueue:updatedDownloads: from a restoreCompletedTransactions when built for Mac but does call it when tested on iPad. The app seems to work in production though and is able to restore purchases successfully. Can anyone confirm this behavior? Is this a bug with Xcode or am I working under incorrect assumptions?
Posted
by
Post not yet marked as solved
0 Replies
324 Views
The Testing Ad Attributions with a Downloaded Profile page, from which we download the IA Pingback delay profile that reduces the wait time for an SKAdNetwork pingback, says: This testing profile expires two weeks after you install it on the device. To continue testing, download the latest profile and reinstall it. In my experience, this seems not to be the case at all. As of this moment, the profile itself was last updated on June 8, 2021. I periodically re-install it just to be safe, but it seems to continue to work longer than 2 weeks from the installation date. Are the docs correct? Do I need to keep refreshing my test devices with the same profile? If the profile really does expire two weeks after installation, can we get one that lasts longer? Having to keep updating the profile on multiple devices is a hassle, and it introduces unnecessary uncertainty into a process that already has a lot of moving parts.
Posted
by
Post not yet marked as solved
1 Replies
380 Views
If User A comes and purchases an AutoRenewable subscription now his subscription is already running and he logs out now User B registers in the same application on the same device and tries to purchase the same plan which User A previously did In the above case How InApp will behave? and How we can detect that Apple id is already occupied with another user.
Posted
by
Post not yet marked as solved
3 Replies
1.2k Views
App is freezing/stuck when user taps on "Not Now" alert action of native StoreReviewController. The issue is on iOS 15.0.2, App works perfectly fine in lower versions (iOS 14.4) We used following code, to collect user review, also tried keeping this line on code in main thread, but no luck.         SKStoreReviewController.requestReview(in: scene) Is there anything we could do to fix? Thanks in advance!
Posted
by
Post not yet marked as solved
3 Replies
785 Views
I've been testing in app purchase using a StoreKit Configuration file in Xcode 13. This is a great feature, and makes things much easier. However, I can't figure out how to reset the state back to initial conditions (i.e. no purchases). On iOS simulators, I have found that the menu command Device->Erase All Content And Settings works. While it's cumbersome, it does the trick. However, I'm testing a Mac catalyst version of my app, and have found several issues with StoreKit testing here. On macOS Big Sur, the reliability of getting a receipt written to my app is very low. Either no _MASReceipt/receipt gets written, or it will get written to for one debugging session, and then stop updating. The only way I have found to get the receipt to update again is to reboot my system. The other, arguably worse problem with Mac catalyst and StoreKit testing, is that I really do need to reset the state to initial conditions. In the course of my app running in the debugger with a very high renewal rate, my receipt has amassed 23,000+ transactions in it. There is no "Reset Contents and Settings" here like in the iOS simulator obviously. And the Xcode transactions editor window comes up empty, so I can't delete them there. I'm sure there's some file/directory somewhere that I can delete, I just have no idea what it is or where to look. Any tips would be appreciated!
Posted
by