1
我創建了一個使用應用程序內購買的應用程序,我已經在iTunes上設置了應用程序內購買,我甚至使用沙箱用戶對其進行了測試,所有這些工作都非常完美。從iMessage應用程序擴展程序購買應用程序
現在我包含了一個iMessage應用程序擴展,同樣的應用程序內購買產品返回invalidProduct ID,但繼續在主應用程序內運行良好。
可能是因爲捆綁ID?
mainapp: com.whatever.bundleid
app iMessage: com.whatever.bundleid.iMessage
iMessage extension: com.whatever.bundleid.iMessage.MessagesExtension
btw,我正在使用SwiftyStoreKit窗格。
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)
}
}
}