【发布时间】:2017-09-15 21:17:26
【问题描述】:
我创建了一个使用应用内购买的应用,我已经在 iTunes 上设置了应用内购买,我什至使用沙盒用户对其进行了测试,所有这些都运行良好。
现在我包含了一个 iMessage 应用扩展,相同的应用内购买产品返回 invalidProduct Id,但在主应用中继续正常工作。
可能是因为捆绑包 ID?
mainapp: com.whatever.bundleid
app iMessage: com.whatever.bundleid.iMessage
iMessage extension: com.whatever.bundleid.iMessage.MessagesExtension
顺便说一句,我正在使用 SwiftyStoreKit pod。
if let inappIndentifier = stickerPackage.inAppPurchaseId {
SwiftyStoreKit.retrieveProductsInfo([inappIndentifier]) { result in
if let product = result.retrievedProducts.first {
let priceString = product.localizedPrice!
completion(true, priceString)
} else if let _ = result.invalidProductIDs.first {
completion(false, nil)
} else {
print("Error: \(result.error)")
completion(false, nil)
}
}
}
【问题讨论】:
标签: ios in-app-purchase imessage