Can't run Example Code "Implementing a store in your app using the StoreKit API"

Hi all, I'm trying to run the sample code - it gives these errors and empty lists of available subscriptions and purchases

2022-07-22 17:32:51.978942+0300 SKDemo[11045:586088] [Default] Error enumerating unfinished transactions for first transaction listener: Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x283f8a7c0 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?REDACTED, AMSStatusCode=404, AMSServerPayload={

    errorCode = 4040003;

    errorMessage = "App not found.";

    okButtonString = OK;

}, NSLocalizedFailureReason=The response has an invalid status code}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}

2022-07-22 17:32:52.426875+0300 SKDemo[11045:586088] [Default] Error enumerating all current transactions: Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x283f8a790 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?REDACTED, AMSStatusCode=404, AMSServerPayload={

    errorCode = 4040003;

    errorMessage = "App not found.";

    okButtonString = OK;

}, NSLocalizedFailureReason=The response has an invalid status code}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}

How do I fix it? Thank you in advance.

Answered by App Store Commerce Engineer in 721306022

Can you please ensure you are following the instruction in ReadMe file and selecting the StoreKit configuration file in schema. Step 1 through 4. This will allow you to run the test app locally in Xcode.

https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api

Accepted Answer

Can you please ensure you are following the instruction in ReadMe file and selecting the StoreKit configuration file in schema. Step 1 through 4. This will allow you to run the test app locally in Xcode.

https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api

Can't run Example Code "Implementing a store in your app using the StoreKit API"
 
 
Q