react-native-iap 14.2.3-rc.1 → 14.3.0
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/README.md +12 -6
- package/android/build.gradle +4 -5
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +327 -543
- package/app.plugin.js +1 -1
- package/ios/HybridRnIap.swift +16 -0
- package/lib/module/helpers/subscription.js.map +1 -1
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +43 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/react-test-renderer.d.js +2 -0
- package/lib/module/types/react-test-renderer.d.js.map +1 -0
- package/lib/module/utils/errorMapping.js.map +1 -1
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
- package/lib/typescript/src/helpers/subscription.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +17 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/errorMapping.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +35 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroDeepLinkOptionsAndroid.hpp +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDeepLinkOptionsAndroid.kt +32 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +19 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +38 -0
- package/nitrogen/generated/ios/swift/NitroDeepLinkOptionsAndroid.swift +84 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/NitroDeepLinkOptionsAndroid.hpp +72 -0
- package/package.json +1 -9
- package/plugin/build/withIAP.js +21 -18
- package/plugin/src/withIAP.ts +80 -72
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/helpers/subscription.ts +11 -11
- package/src/hooks/useIAP.ts +193 -193
- package/src/index.ts +394 -344
- package/src/specs/RnIap.nitro.ts +182 -157
- package/src/types/react-test-renderer.d.ts +7 -0
- package/src/types.ts +294 -294
- package/src/utils/errorMapping.ts +13 -13
- package/src/utils/type-bridge.ts +94 -93
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/plugin/build/src/withIAP.d.ts +0 -3
- package/plugin/build/src/withIAP.js +0 -81
- package/plugin/build/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
[](https://npmjs.org/package/react-native-iap)
|
|
8
8
|
[](https://npmjs.org/package/react-native-iap)
|
|
9
9
|
[](https://opencollective.com/react-native-iap)
|
|
10
|
+
[](https://github.com/hyochan/react-native-iap/actions/workflows/ci-test.yml)
|
|
10
11
|
[](https://codecov.io/gh/hyochan/react-native-iap)
|
|
11
12
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fhyochan%2Freact-native-iap?ref=badge_shield&issueType=license)
|
|
12
13
|
|
|
@@ -23,6 +24,15 @@
|
|
|
23
24
|
|
|
24
25
|
**Starting from version 14.0.0**, this library uses [Nitro Modules](https://github.com/mrousavy/nitro) for high-performance native bridge implementation. You must install `react-native-nitro-modules` alongside `react-native-iap`.
|
|
25
26
|
|
|
27
|
+
### Compatibility (Nitro 14.x)
|
|
28
|
+
|
|
29
|
+
- `react-native-iap@14.x` (Nitro) requires **React Native 0.79+**.
|
|
30
|
+
- Stuck on **RN 0.75.x or lower**? Use the last pre‑Nitro version: `npm i react-native-iap@13.1.0`.
|
|
31
|
+
- Seeing Swift 6 C++ interop errors in Nitro (e.g., `AnyMap.swift` with `cppPart.pointee.*`)? Temporarily pin Swift to **5.10** for the `NitroModules` pod (see Installation docs) or upgrade RN and Nitro deps.
|
|
32
|
+
- Recommended: upgrade to RN 0.79+, update `react-native-nitro-modules`/`nitro-codegen`, then `pod install` and clean build.
|
|
33
|
+
|
|
34
|
+
More details and the Podfile snippet are in the docs: https://hyochan.github.io/react-native-iap/docs/installation#ios
|
|
35
|
+
|
|
26
36
|
## ✨ Features
|
|
27
37
|
|
|
28
38
|
- 🔄 **Cross-platform Support**: Works seamlessly on both iOS and Android
|
|
@@ -80,15 +90,11 @@ Before installing React Native IAP, make sure you have:
|
|
|
80
90
|
|
|
81
91
|
#### Android Configuration
|
|
82
92
|
|
|
83
|
-
Add the
|
|
93
|
+
Add the OpenIAP Google library to your `android/app/build.gradle` dependencies:
|
|
84
94
|
|
|
85
95
|
```gradle
|
|
86
96
|
dependencies {
|
|
87
|
-
|
|
88
|
-
implementation "com.android.billingclient:billing-ktx:8.0.0"
|
|
89
|
-
|
|
90
|
-
// Google Play Services
|
|
91
|
-
implementation "com.google.android.gms:play-services-base:18.1.0"
|
|
97
|
+
implementation "io.github.hyochan.openiap:openiap-google:1.1.0"
|
|
92
98
|
}
|
|
93
99
|
```
|
|
94
100
|
|
package/android/build.gradle
CHANGED
|
@@ -124,7 +124,6 @@ android {
|
|
|
124
124
|
// Configure Kotlin compiler to match Java compatibility
|
|
125
125
|
kotlinOptions {
|
|
126
126
|
jvmTarget = "17"
|
|
127
|
-
freeCompilerArgs += ["-Xskip-metadata-version-check"]
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
lintOptions {
|
|
@@ -151,14 +150,14 @@ dependencies {
|
|
|
151
150
|
implementation project(":react-native-nitro-modules")
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
// Google Play Billing Library
|
|
155
|
-
implementation 'com.android.billingclient:billing-ktx:8.0.0'
|
|
156
|
-
|
|
157
153
|
// Google Play Services
|
|
158
154
|
implementation 'com.google.android.gms:play-services-base:18.5.0'
|
|
159
155
|
|
|
160
156
|
// Kotlin coroutines
|
|
161
|
-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.
|
|
157
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0'
|
|
158
|
+
|
|
159
|
+
// OpenIAP Google (v1.1.0)
|
|
160
|
+
implementation 'io.github.hyochan.openiap:openiap-google:1.1.0'
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
configurations.all {
|