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 +2 -1
- package/ios/RnIapHelper.swift +9 -4
- package/openiap-versions.json +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
package/ios/RnIapHelper.swift
CHANGED
|
@@ -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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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 }
|
package/openiap-versions.json
CHANGED
package/package.json
CHANGED