react-native-iap 14.4.28 → 14.4.29

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.
package/NitroIap.podspec CHANGED
@@ -42,7 +42,8 @@ Pod::Spec.new do |s|
42
42
  s.dependency 'React-jsi'
43
43
  s.dependency 'React-callinvoker'
44
44
  # OpenIAP Apple for StoreKit 2 integration
45
- s.dependency 'openiap', apple_version
45
+ # Use ~> to allow patch updates (e.g., 1.2.30 -> 1.2.31, but not 1.3.0)
46
+ s.dependency 'openiap', "~> #{apple_version}"
46
47
 
47
48
  install_modules_dependencies(s)
48
49
  end
@@ -65,10 +65,15 @@ enum RnIapHelper {
65
65
  if let typeIOS = dictionary["typeIOS"] as? String { product.typeIOS = typeIOS }
66
66
  if let familyShareable = boolValue(dictionary["isFamilyShareableIOS"]) { product.isFamilyShareableIOS = familyShareable }
67
67
  if let jsonRepresentation = dictionary["jsonRepresentationIOS"] as? String { product.jsonRepresentationIOS = jsonRepresentation }
68
- if let discounts = dictionary["discountsIOS"] as? [[String: Any]] {
69
- if let jsonData = try? JSONSerialization.data(withJSONObject: discounts, options: []),
70
- let jsonString = String(data: jsonData, encoding: .utf8) {
71
- product.discountsIOS = jsonString
68
+ // Handle discountsIOS - OpenIAP 1.2.30+ returns [[String: Any]] (non-nullable)
69
+ if let discountsArray = dictionary["discountsIOS"] as? [[String: Any]] {
70
+ do {
71
+ let jsonData = try JSONSerialization.data(withJSONObject: discountsArray, options: [])
72
+ if let jsonString = String(data: jsonData, encoding: .utf8) {
73
+ product.discountsIOS = jsonString
74
+ }
75
+ } catch {
76
+ NSLog("⚠️ [RnIapHelper] Failed to serialize discountsIOS: \(error)")
72
77
  }
73
78
  }
74
79
  if let subscriptionUnit = dictionary["subscriptionPeriodUnitIOS"] as? String { product.subscriptionPeriodUnitIOS = subscriptionUnit }
@@ -1,5 +1,5 @@
1
1
  {
2
- "apple": "1.2.29",
2
+ "apple": "1.2.30",
3
3
  "google": "1.3.2",
4
4
  "gql": "1.2.3"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "14.4.28",
3
+ "version": "14.4.29",
4
4
  "description": "React Native In-App Purchases module for iOS and Android using Nitro",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",