Thursday, May 21, 2026
HomeiOS Developmentios - StoreKit.StoreKitError.unknown thrown by attempt await Product.merchandise(for: productIdentifiers) utilizing StorekitTest testcases

ios – StoreKit.StoreKitError.unknown thrown by attempt await Product.merchandise(for: productIdentifiers) utilizing StorekitTest testcases

[ad_1]

StoreKit.StoreKitError.unknown is being thrown by
attempt await Product.merchandise(for: productIdentifiers)
when utilizing StoreKitTest.framework to write down testcases for In app buy utilizing the .configuration file.

imported following frameworks in file:

import XCTest
import StoreKitTest

Following code is just not throwing any error

do{
    session = attempt SKTestSession(configurationFileNamed: "IAPSubscriptions")
    session?.resetToDefaultState()
    session?.disableDialogs = true
    session?.clearTransactions()
    XCTAssert(session != nil)
}catch{
    XCTFail("IAPSubscriptions.storekit configuration file couldn't be loaded")
}

Following code is throwing error:

do{
    let productIdentifier = "com.take a look at.monthly_19"
    let merchandise = attempt await retailer.requestWithProductIdentifiers(productIdentifiers: [productIdentifier])
    XCTAssert(merchandise.depend  1)
}catch{
    XCTFail() //StoreKit.StoreKitError.unknown
}

How shall I resolve this?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments