我使用SwiftyStoreKit创建我的应用内购买。 RestorePurchases可以正常工作,但是在使用PurchaseProduct时,会出现 App Crase并显示成功消息:“您的购买成功。”和崩溃显示如下。我在项目中未使用任何timeIntervalSince1970和Boolean。
**** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[__NSCFBoolean timeIntervalSince1970]: unrecognized selector sent to instance 0x1f86f95f0'****
我在didFinishlaunchingWithOptions中的AppDelegate中实现了SwiftyStoreKit.completeTransactions块,而我的PurchaseProduct代码是-
SwiftyStoreKit.purchaseProduct(My_Purchase_Identifier,quantity: 1,atomically: true) { result in
switch result {
case .success(let purchase):
print("Purchase Success: \(purchase.productId)")
SwiftyStoreKit.finishTransaction(purchase.transaction)
case .error(let error):
print("Purchase with error")
}
}
请帮助我。任何建议表示赞赏。谢谢。