Post

Replies

Boosts

Views

Activity

Xcode 12 StoreKit Configuration file not used by unit tests
Hello, I have added a Xcode 12 StoreKit Configuration file (.storekit) so I can test purchases, and added it to the scheme for running my target in debug mode - the config file is working great when I run the application in an Xcode simulator. However, I also have a suite of Xcode unit tests, and when I run those with an iOS 14 simulator it appears the StoreKit Configuration file is not active as all product requests for SKProduct fail. The requests all work normally in an iOS 13 simulator. Is there somewhere else I need to enable a StoreKit Configuration file for unit tests specifically? I tried adding an SKTestSession into a unit test initialized with the name of my StoreKit config but that did not help, as I'm not using the SKTestSession to make purchases but trying to trigger purchase mechanisms in my application itself. I also found some advice online to wait five seconds after launch and then it would work (???) but that didn't work for me either.
1
0
1.7k
Nov ’20
How to simulate purchase interruption in Xcode 12?
I have an issue with an app in the store, where someone trying to purchase with a expired credit card in the account, causes some kind of problem with the eventual purchase being recognized in my application after they fix billing. I was trying to test this scenario in Xcode 12, using the new StoreKit configuration files - I set up a configuration with a product, then selected "Enable interrupted Purchase" in the editor menu. When I made a purchase with that on, I eventually got back an error transaction in my StoreKit transaction listener. But I'm not sure if that is right, wouldn't it be "deferred" if the user went to go correct billing info? Also I see no way in Xcode to continue the purchase flow from an interruption, it just seems to send the error transaction then it is done - so I can't test the full scenario of correcting the billing issue and completing the purchase. In the documentation for testing common StoreKit scenarios here: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_at_all_stages_of_development_with_xcode_and_sandbox It explicitly says this can be done with StoreKit testing in Xcode: "Test a failed purchase attempt when payment authorization failed" So I am looking to see if I am testing the right thing, or there is something else I need to do to test a payment authorization failed flow. Thanks!
2
0
1.7k
Jul ’20
iPhone 14 simulator not loading SKProducts
I was testing my app using the Xcode 12 beta, in an iOS 14 simulator - when it tried to load SKProducts (all subscriptions) that normally have been loading just fine, I got back an error: Error Domain=SKErrorDomain Code=0 "UNKNOWNERROR" UserInfo={NSLocalizedDescription=UNKNOWNERROR, NSUnderlyingError=0x600000c903f0 {Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response}}} Will we still be able to load products in simulators going forward, or can we only load the local test versions of products from the new StoreKit configuration files? I would really, really still like to be able to load production products in a simulator so I can see the actual data that is in AppStore connect.
7
0
11k
Jun ’20
Where has Automation Instrument gone?
In expirmenting with Xcode8 recently, I noticed that the Automation Intrument appears to not be there anymore... I know you can use UI testing in Xcode now to do some things Automation was doing, but that doesn't seem to include things like ways to simualte location changes (I was using Automation to simulate location changes including speed, which GPX files do not do).Has that instrument gone entirely, or is there something I need to do to enable it?
2
0
4.0k
Aug ’16