react-native-nami-sdk 3.4.0-dev.202605191752 → 3.4.0-dev.202605201800
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/android/build.gradle
CHANGED
|
@@ -85,8 +85,8 @@ dependencies {
|
|
|
85
85
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
86
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
87
87
|
|
|
88
|
-
playImplementation "com.namiml:sdk-android:3.4.0-dev.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.4.0-dev.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.4.0-dev.202605201800"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.4.0-dev.202605201800"
|
|
90
90
|
|
|
91
91
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
92
92
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
|
package/dist/src/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.4.0-dev.
|
|
3
|
+
"version": "3.4.0-dev.202605201800",
|
|
4
4
|
"description": "React Native SDK for Nami - No-code paywall and onboarding flows with A/B testing.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@namiml/expo-nami-iap": "3.4.0-dev.
|
|
66
|
+
"@namiml/expo-nami-iap": "3.4.0-dev.202605201800",
|
|
67
67
|
"react": ">=18",
|
|
68
68
|
"react-native": ">=0.73"
|
|
69
69
|
},
|
|
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
s.requires_arc = true
|
|
22
22
|
s.swift_version = '5.0' # or your supported version
|
|
23
23
|
|
|
24
|
-
s.dependency 'Nami', '3.4.0-dev.
|
|
24
|
+
s.dependency 'Nami', '3.4.0-dev.202605201800'
|
|
25
25
|
|
|
26
26
|
pod_target_xcconfig = {
|
|
27
27
|
'DEFINES_MODULE' => 'YES',
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Mock react-native BEFORE importing the SDK — `../Nami` resolves
|
|
2
|
+
// the native module via TurboModuleRegistry at import time.
|
|
3
|
+
const reset = jest.fn().mockResolvedValue(undefined);
|
|
4
|
+
const sdkVersion = jest.fn().mockResolvedValue('test');
|
|
5
|
+
|
|
6
|
+
jest.mock('react-native', () => ({
|
|
7
|
+
TurboModuleRegistry: {
|
|
8
|
+
getEnforcing: jest.fn(() => ({ reset, sdkVersion })),
|
|
9
|
+
},
|
|
10
|
+
NativeModules: {
|
|
11
|
+
RNNami: { reset, sdkVersion },
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
import { Nami } from '../Nami';
|
|
16
|
+
|
|
17
|
+
describe('Nami.reset (React Native bridge)', () => {
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
reset.mockClear();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('exposes reset() as an async function on the JS surface', () => {
|
|
23
|
+
expect(typeof Nami.reset).toBe('function');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('delegates to the native RNNami.reset() turbomodule method', async () => {
|
|
27
|
+
await Nami.reset();
|
|
28
|
+
expect(reset).toHaveBeenCalledTimes(1);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('returns a promise that resolves once the native call settles', async () => {
|
|
32
|
+
const result = Nami.reset();
|
|
33
|
+
expect(result).toBeInstanceOf(Promise);
|
|
34
|
+
await expect(result).resolves.toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('propagates native bridge rejections to the JS caller', async () => {
|
|
38
|
+
const err = new Error('native reset failed');
|
|
39
|
+
reset.mockRejectedValueOnce(err);
|
|
40
|
+
await expect(Nami.reset()).rejects.toThrow('native reset failed');
|
|
41
|
+
});
|
|
42
|
+
});
|
package/src/version.ts
CHANGED