rampkit-expo-dev 0.0.49 → 0.0.50

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.
@@ -471,18 +471,15 @@ public class RampKitModule: Module {
471
471
  if transaction.isUpgraded {
472
472
  eventName = "subscription_upgraded"
473
473
  } else {
474
- switch transaction.productType {
475
- case .autoRenewable:
474
+ // Determine event based on product type
475
+ let productType = transaction.productType
476
+ if productType == .autoRenewable {
476
477
  if transaction.originalID == transaction.id {
477
478
  eventName = "purchase_completed"
478
479
  } else {
479
480
  eventName = "subscription_renewed"
480
481
  }
481
- case .consumable, .nonConsumable:
482
- eventName = "purchase_completed"
483
- case .nonRenewable:
484
- eventName = "purchase_completed"
485
- @unknown default:
482
+ } else {
486
483
  eventName = "purchase_completed"
487
484
  }
488
485
  }
@@ -539,12 +536,17 @@ public class RampKitModule: Module {
539
536
 
540
537
  @available(iOS 15.0, *)
541
538
  private func mapProductType(_ type: Product.ProductType) -> String {
542
- switch type {
543
- case .consumable: return "consumable"
544
- case .nonConsumable: return "non_consumable"
545
- case .autoRenewable: return "auto_renewable"
546
- case .nonRenewable: return "non_renewable"
547
- @unknown default: return "unknown"
539
+ // Use if-else to avoid switch exhaustiveness issues with resilient enums
540
+ if type == .consumable {
541
+ return "consumable"
542
+ } else if type == .nonConsumable {
543
+ return "non_consumable"
544
+ } else if type == .autoRenewable {
545
+ return "auto_renewable"
546
+ } else if type == .nonRenewable {
547
+ return "non_renewable"
548
+ } else {
549
+ return "unknown"
548
550
  }
549
551
  }
550
552
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampkit-expo-dev",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "description": "The Expo SDK for RampKit. Build, test, and personalize app onboardings with instant updates.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",