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
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
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 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
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 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
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 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
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 not yet marked as solved
1 Replies
335 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
1 Replies
219 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 marked as solved
1 Replies
359 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
239 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 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
0 Replies
202 Views
Our App uses storekit v1 to set applicationname to a string in UUID format, and our backend gets the same value in the appAccountToken in the apple store notification. In-app purchases of our app are auto-renewable and found in sandbox environment testing. After placing several orders in a short period of time, the appAccountToken in the notification received by our backend is the same value in UUID format. But the app sets the applicationname to be a different UUID format value each time an order is placed. What is the reason for this, is it normal?
Posted
by
Post not yet marked as solved
2 Replies
361 Views
Hi, I'm getting the following error while uploading the iOS build from Xcode: Profile doesn't include the com.apple.security.app-sandbox and com.apple.security.files.user-selected.read-write entitlements I have also created an .entitlements file turning on both sandbox and user selected rights.  I can also see the required entitlements in signing and capabilities tab under app's target section.  I have also tried deleting all provisioning files from ~/Library/MobileDevice/Provisioning\ Profiles/ and re-downloading them again. The build is getting succeeded but I'm not able to upload it to app store connect. Any help or suggestions will mean a lot. Thanks!
Posted
by
Post not yet marked as solved
2 Replies
332 Views
I'm unable to test Subscription renewal via StoreKit Testing in Xcode unless the subscription is a monthly subscription. I'm trying to test a weekly subscription but under the Editor menu there is no entires for anything other than Monthly? (Xcode 13.3). Setting the interval to the fastest ("Monthly Renewal Every 30 Seconds") does nothing if the active subscription is a weekly subscription. Is there no way to test subscriptions unless they are monthly?
Post not yet marked as solved
1 Replies
214 Views
Here's the scenario– App downloaded via TestFlight appStoreReceiptURL is retrieved Checks if there is a receipt at that URL ------> If NOT found–> a new request is via the following, and that's when the authentication dialog pops up, it is successful when sandbox account credentials are entered. Otherwise it fails let request = SKReceiptRefreshRequest(receiptProperties: nil) request.delegate = self request.start() My Question is (and I have no way to know this for sure), when app is in production, and downloaded from the App Store (Not TestFlight), would that also have the same authentication dialog pop? At this point I was assuming this authentication event is due to TestFligth and Sandbox Apple Account. [mistakenly selected answered to the question asked earlier– hence re-asking]
Posted
by
Post not yet marked as solved
1 Replies
192 Views
I can not add myself to a sandbox testers. I see the "+" button But the problem is i am trying to add myself. I already have myself there! I tapped "+", when i earn all fields it says user already exists. Whats wrong? How can i. test my purchase??
Posted
by