@capgo/native-purchases 0.0.66 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,10 @@ public class NativePurchasesPlugin: CAPPlugin {
40
40
  Task {
41
41
  do {
42
42
  let products = try await Product.products(for: [productIdentifier])
43
- let product = products[0]
43
+ guard let product = products.first else {
44
+ call.reject("Cannot find product for id \(productIdentifier)")
45
+ return
46
+ }
44
47
  var purchaseOptions = Set<Product.PurchaseOption>()
45
48
  purchaseOptions.insert(Product.PurchaseOption.quantity(quantity))
46
49
  let result = try await product.purchase(options: purchaseOptions)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-purchases",
3
- "version": "0.0.66",
3
+ "version": "0.0.67",
4
4
  "description": "In-app Subscriptions Made Easy",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",