SwiftyStoreKit 和 AppStore Connect 版主的应用内购买问题
In-app purchases trouble with SwiftyStoreKit and AppStore Connect moderator
我是应用内购买和 SwiftyStoreKit 方面的新手。
我在我的应用程序中进行了应用程序内购买并将其发送以供审核。
我的申请版主拒绝并写下原因:
We found that your in-app purchase products exhibited one or more bugs
when reviewed on iPhone and iPad running iOS 14.1 on Wi-Fi.
Specifically, your app’s In-App Purchases do not show the app’s price.
Also, upon further review, we found that your app does not allow users
to purchase the In-App Purchases.
Next Steps
When validating receipts on your server, your server needs to be able
to handle a production-signed app getting its receipts from Apple’s
test environment. The recommended approach is for your production
server to always validate receipts against the production App Store
first. If validation fails with the error code "Sandbox receipt used
in production," you should validate against the test environment
instead.
价格未显示可能是因为应用程序收到了应答代码:“skerrordomain code=0”或类似的代码。或者因为Apple服务器返回了0个产品。
即ViewController启动时,app向Apple服务器请求产品价格,然后写入按钮。
我不知道到底是什么问题,因为在我的本地设备上购买是与 Sandbox 用户一起使用的。在模拟器中我得到一个错误:“skerrordomain code=0”。
这是一个代码示例:
enum RegisteredPurchase: String {
case item1 = "com.app.appname.item1"
case item2 = "com.app.appname.item2"
case item3 = "com.app.appname.item3"
}
purchases: [RegisteredPurchase]
var productList: Set<String> = []
for purchase in purchases {
productList.insert(purchase.rawValue)
}
SwiftyStoreKit.retrieveProductsInfo(productList) { result in
var products: Dictionary<RegisteredPurchase, String> = [:]
for product in result.retrievedProducts {
products[RegisteredPurchase(rawValue: product.productIdentifier)!] = product.localizedPrice
}
if (result.error == nil) {
self.setupPrice(products)
}
}
在结果中我得到了 retrievedProducts。在本地设备上,所有 3 个产品都出现了,在模拟器中我得到 0 和错误。
已通过删除所有产品并创建新产品进行修复。
我是应用内购买和 SwiftyStoreKit 方面的新手。
我在我的应用程序中进行了应用程序内购买并将其发送以供审核。
我的申请版主拒绝并写下原因:
We found that your in-app purchase products exhibited one or more bugs when reviewed on iPhone and iPad running iOS 14.1 on Wi-Fi.
Specifically, your app’s In-App Purchases do not show the app’s price. Also, upon further review, we found that your app does not allow users to purchase the In-App Purchases.
Next Steps
When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.
价格未显示可能是因为应用程序收到了应答代码:“skerrordomain code=0”或类似的代码。或者因为Apple服务器返回了0个产品。
即ViewController启动时,app向Apple服务器请求产品价格,然后写入按钮。
我不知道到底是什么问题,因为在我的本地设备上购买是与 Sandbox 用户一起使用的。在模拟器中我得到一个错误:“skerrordomain code=0”。
这是一个代码示例:
enum RegisteredPurchase: String {
case item1 = "com.app.appname.item1"
case item2 = "com.app.appname.item2"
case item3 = "com.app.appname.item3"
}
purchases: [RegisteredPurchase]
var productList: Set<String> = []
for purchase in purchases {
productList.insert(purchase.rawValue)
}
SwiftyStoreKit.retrieveProductsInfo(productList) { result in
var products: Dictionary<RegisteredPurchase, String> = [:]
for product in result.retrievedProducts {
products[RegisteredPurchase(rawValue: product.productIdentifier)!] = product.localizedPrice
}
if (result.error == nil) {
self.setupPrice(products)
}
}
在结果中我得到了 retrievedProducts。在本地设备上,所有 3 个产品都出现了,在模拟器中我得到 0 和错误。
已通过删除所有产品并创建新产品进行修复。