HomeiOS DevelopmentSKTestSession.buyProduct(identifier: choices:) throws error

SKTestSession.buyProduct(identifier: choices:) throws error


Overview

  • I’m attempting to put in writing a unit check case to purchase a storekit product.
  • SKTestSession.buyProduct(identifier: choices:) throws the error StoreKit.StoreKitError.notEntitled

Testcase Code

@Check func instance() async throws {
    let session = strive SKTestSession(configurationFileNamed: "VehicleStore")
    session.disableDialogs = true
    session.clearTransactions()
    do {
        let transaction = strive await session.buyProduct(identifier: "nonconsumable.automobile", choices: [])
        print(transaction)
    } catch {
        // Throws StoreKit.StoreKitError.notEntitled
        print("Error: (error)")
    }
}

Storekit configuration file

SKTestSession.buyProduct(identifier: choices:) throws error

Be aware

  • In-App purchases functionality is added
  • StoreKit configuration file is utilized in testcase

Surroundings:

  • macOS 26.5.2 (25F84)
  • Xcode 26.6 (17F113)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments