react-native-iap 16.4.1 → 16.5.1
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 +2 -0
- package/android/build.gradle +19 -21
- package/android/fix-prefab.gradle +11 -24
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +200 -142
- package/android/src/main/java/com/margelo/nitro/iap/TokenizedListenerRegistry.kt +0 -1
- package/ios/HybridRnIap.swift +832 -165
- package/ios/RnIapHelper.swift +1 -1
- package/lib/module/hooks/useIAP.js +48 -32
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +207 -153
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.kepler.js +1 -0
- package/lib/module/index.kepler.js.map +1 -1
- package/lib/module/kit-api.js +9 -5
- package/lib/module/kit-api.js.map +1 -1
- package/lib/module/types.js +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/error.js +5 -4
- package/lib/module/utils/error.js.map +1 -1
- package/lib/module/vega-adapter.js +4 -1
- package/lib/module/vega-adapter.js.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +31 -15
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +28 -14
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.kepler.d.ts.map +1 -1
- package/lib/typescript/src/kit-api.d.ts +9 -5
- package/lib/typescript/src/kit-api.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +12 -2
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/error.d.ts.map +1 -1
- package/lib/typescript/src/vega-adapter.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +1 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +7 -1
- package/nitrogen/generated/android/c++/JNitroPurchaseRequestType.hpp +58 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitHorizonProps.hpp +66 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitProps.hpp +8 -1
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderProps.hpp +3 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_NitroVerifyPurchaseWithIapkitHorizonProps.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_NitroVerifyPurchaseWithIapkitHorizonProps.hpp +74 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_NitroVerifyPurchaseWithIapkitProps.hpp +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +8 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequestType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitHorizonProps.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitProps.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_NitroVerifyPurchaseWithIapkitHorizonProps.kt +62 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +65 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +6 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +6 -0
- package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +13 -2
- package/nitrogen/generated/ios/swift/NitroPurchaseRequestType.swift +40 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitHorizonProps.swift +66 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitProps.swift +38 -1
- package/nitrogen/generated/ios/swift/Variant_NullType_NitroVerifyPurchaseWithIapkitHorizonProps.swift +30 -0
- package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +9 -2
- package/nitrogen/generated/shared/c++/NitroPurchaseRequestType.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitHorizonProps.hpp +90 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitProps.hpp +8 -1
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/hooks/useIAP.ts +96 -58
- package/src/index.kepler.ts +1 -0
- package/src/index.ts +249 -196
- package/src/kit-api.ts +10 -6
- package/src/specs/RnIap.nitro.ts +12 -0
- package/src/types.ts +13 -2
- package/src/utils/error.ts +7 -3
- package/src/vega-adapter.ts +9 -5
package/README.md
CHANGED
|
@@ -152,6 +152,7 @@ Other libraries built on OpenIAP: [expo-iap](https://github.com/hyodotdev/openia
|
|
|
152
152
|
|
|
153
153
|
<!-- sponsors:start -->
|
|
154
154
|
<!-- Generated by scripts/sync-sponsors.mjs from packages/docs/sponsor-registry.json. -->
|
|
155
|
+
|
|
155
156
|
## Sponsors
|
|
156
157
|
|
|
157
158
|
<p align="center">
|
|
@@ -198,6 +199,7 @@ Supported the project before the OpenIAP sponsor program.
|
|
|
198
199
|
[openiap-opencollective]: https://opencollective.com/openiap
|
|
199
200
|
[openiap-paypal]: https://www.paypal.me/dooboolab
|
|
200
201
|
[openiap-company-contact]: mailto:hyo@hyo.dev
|
|
202
|
+
|
|
201
203
|
<!-- sponsors:end -->
|
|
202
204
|
|
|
203
205
|
## Community
|
package/android/build.gradle
CHANGED
|
@@ -79,12 +79,17 @@ if (!(googleVersion instanceof String) || !googleVersion.trim()) {
|
|
|
79
79
|
def googleVersionString = googleVersion.trim()
|
|
80
80
|
|
|
81
81
|
apply plugin: "com.android.library"
|
|
82
|
-
|
|
82
|
+
// AGP 9 registers Kotlin itself unless the consumer opts out.
|
|
83
|
+
if (project.extensions.findByName('kotlin') == null) {
|
|
84
|
+
apply plugin: 'org.jetbrains.kotlin.android'
|
|
85
|
+
}
|
|
83
86
|
|
|
84
87
|
// Only apply Nitro autolinking if the file exists
|
|
85
88
|
def nitroAutolinkingFile = file('../nitrogen/generated/android/NitroIap+autolinking.gradle')
|
|
86
89
|
if (nitroAutolinkingFile.exists()) {
|
|
87
90
|
apply from: nitroAutolinkingFile
|
|
91
|
+
// Built-in Kotlin does not compile custom java.srcDirs added by Nitrogen.
|
|
92
|
+
android.sourceSets.main.kotlin.srcDir('../nitrogen/generated/android/kotlin')
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
apply from: "./fix-prefab.gradle"
|
|
@@ -151,11 +156,11 @@ android {
|
|
|
151
156
|
namespace = "com.margelo.nitro.iap"
|
|
152
157
|
|
|
153
158
|
ndkVersion = getExtOrDefault("ndkVersion")
|
|
154
|
-
|
|
159
|
+
compileSdk = getExtOrIntegerDefault("compileSdkVersion")
|
|
155
160
|
|
|
156
161
|
defaultConfig {
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
minSdk = getExtOrIntegerDefault("minSdkVersion")
|
|
163
|
+
targetSdk = getExtOrIntegerDefault("targetSdkVersion")
|
|
159
164
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
160
165
|
// Ship consumer keep rules so Nitro HybridObjects aren't stripped in app release builds
|
|
161
166
|
consumerProguardFiles 'consumer-rules.pro'
|
|
@@ -168,15 +173,6 @@ android {
|
|
|
168
173
|
cppFlags "-frtti -fexceptions -Wall -Wextra -fstack-protector-all"
|
|
169
174
|
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
170
175
|
abiFilters (*reactNativeArchitectures())
|
|
171
|
-
|
|
172
|
-
buildTypes {
|
|
173
|
-
debug {
|
|
174
|
-
cppFlags "-O1 -g"
|
|
175
|
-
}
|
|
176
|
-
release {
|
|
177
|
-
cppFlags "-O2"
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
178
|
}
|
|
@@ -187,10 +183,8 @@ android {
|
|
|
187
183
|
}
|
|
188
184
|
}
|
|
189
185
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"META-INF",
|
|
193
|
-
"META-INF/**",
|
|
186
|
+
packaging {
|
|
187
|
+
def excludedLibraries = [
|
|
194
188
|
"**/libc++_shared.so",
|
|
195
189
|
"**/libfbjni.so",
|
|
196
190
|
"**/libjsi.so",
|
|
@@ -206,6 +200,8 @@ android {
|
|
|
206
200
|
"**/libreact_nativemodule_core.so",
|
|
207
201
|
"**/libjscexecutor.so"
|
|
208
202
|
]
|
|
203
|
+
resources.excludes += ["META-INF", "META-INF/**"] + excludedLibraries
|
|
204
|
+
jniLibs.excludes += excludedLibraries
|
|
209
205
|
}
|
|
210
206
|
|
|
211
207
|
buildFeatures {
|
|
@@ -214,8 +210,12 @@ android {
|
|
|
214
210
|
}
|
|
215
211
|
|
|
216
212
|
buildTypes {
|
|
213
|
+
debug {
|
|
214
|
+
externalNativeBuild.cmake.cppFlags "-O1 -g"
|
|
215
|
+
}
|
|
217
216
|
release {
|
|
218
217
|
minifyEnabled = false
|
|
218
|
+
externalNativeBuild.cmake.cppFlags "-O2"
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -224,11 +224,9 @@ android {
|
|
|
224
224
|
targetCompatibility JavaVersion.VERSION_17
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
disable "GradleCompatible"
|
|
227
|
+
lint {
|
|
228
|
+
disable += "GradleCompatible"
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
// Removed sourceSets configuration for codegen as it's not needed for library modules
|
|
232
230
|
}
|
|
233
231
|
|
|
234
232
|
kotlin {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
tasks.configureEach { task ->
|
|
2
|
-
//
|
|
3
|
-
// so that not a header publication file, but a full configuration publication will be generated, which
|
|
4
|
-
// will include the .so file
|
|
2
|
+
// Publish prefab metadata only after its native library exists.
|
|
5
3
|
|
|
6
4
|
def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/
|
|
7
5
|
def matcher = task.name =~ prefabConfigurePattern
|
|
@@ -12,14 +10,16 @@ tasks.configureEach { task ->
|
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
gradle.projectsEvaluated {
|
|
16
14
|
def abis = reactNativeArchitectures()
|
|
17
15
|
rootProject.allprojects.each { proj ->
|
|
18
16
|
if (proj === rootProject) return
|
|
19
17
|
|
|
20
18
|
def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config ->
|
|
21
|
-
config.
|
|
22
|
-
dep
|
|
19
|
+
config.allDependencies.any { dep ->
|
|
20
|
+
dep instanceof ProjectDependency
|
|
21
|
+
? dep.path == project.path
|
|
22
|
+
: dep.group == project.group && dep.name == project.name
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
if (!dependsOnThisLib && proj != project) return
|
|
@@ -28,24 +28,11 @@ afterEvaluate {
|
|
|
28
28
|
return
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def variantName = variant.name
|
|
37
|
-
abis.each { abi ->
|
|
38
|
-
def searchDir = new File(proj.projectDir, ".cxx/${variantName}")
|
|
39
|
-
if (!searchDir.exists()) return
|
|
40
|
-
def matches = []
|
|
41
|
-
searchDir.eachDir { randomDir ->
|
|
42
|
-
def prefabFile = new File(randomDir, "${abi}/prefab_config.json")
|
|
43
|
-
if (prefabFile.exists()) matches << prefabFile
|
|
44
|
-
}
|
|
45
|
-
matches.each { prefabConfig ->
|
|
46
|
-
prefabConfig.setLastModified(System.currentTimeMillis())
|
|
47
|
-
}
|
|
48
|
-
}
|
|
31
|
+
// Refresh existing prefab metadata so CMake discovers newly built libraries.
|
|
32
|
+
proj.fileTree('.cxx') {
|
|
33
|
+
abis.each { abi -> include "*/*/${abi}/prefab_config.json" }
|
|
34
|
+
}.each { prefabConfig ->
|
|
35
|
+
prefabConfig.setLastModified(System.currentTimeMillis())
|
|
49
36
|
}
|
|
50
37
|
}
|
|
51
38
|
}
|