react-native-nami-sdk 3.4.0-rc.202605260303 → 3.4.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/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
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.4.0
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.4.0"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.4.0"
|
|
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"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { NativeEventEmitter } from 'react-native';
|
|
3
2
|
export declare const NamiOverlayControl: {
|
|
4
3
|
emitter: NativeEventEmitter;
|
|
@@ -6,6 +5,5 @@ export declare const NamiOverlayControl: {
|
|
|
6
5
|
finishOverlay(result?: any): Promise<void>;
|
|
7
6
|
onOverlayReady(handler: () => void): () => void;
|
|
8
7
|
onOverlayResult(handler: (result: any) => void): () => void;
|
|
9
|
-
setOverlayContent(component: React.ComponentType | null): void;
|
|
10
8
|
};
|
|
11
9
|
export default function NamiOverlayHost(): any;
|
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
|
|
3
|
+
"version": "3.4.0",
|
|
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
|
|
66
|
+
"@namiml/expo-nami-iap": "3.4.0",
|
|
67
67
|
"react": ">=18",
|
|
68
68
|
"react-native": ">=0.73"
|
|
69
69
|
},
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
1
|
import { AppRegistry, View, StyleSheet } from 'react-native';
|
|
3
2
|
import {
|
|
4
3
|
TurboModuleRegistry,
|
|
@@ -13,12 +12,6 @@ const RNNamiOverlayControl: Spec =
|
|
|
13
12
|
|
|
14
13
|
const emitter = new NativeEventEmitter(NativeModules.RNNamiOverlayControl);
|
|
15
14
|
|
|
16
|
-
// `NamiOverlayHost` is mounted in a separate RCTRootView, so it cannot share
|
|
17
|
-
// React context with the main app tree. We use a module-level singleton +
|
|
18
|
-
// listener set to cross that boundary.
|
|
19
|
-
let registeredContent: React.ComponentType | null = null;
|
|
20
|
-
const contentListeners = new Set<() => void>();
|
|
21
|
-
|
|
22
15
|
export const NamiOverlayControl = {
|
|
23
16
|
emitter,
|
|
24
17
|
|
|
@@ -50,29 +43,9 @@ export const NamiOverlayControl = {
|
|
|
50
43
|
const sub = emitter.addListener('NamiOverlayResult', handler);
|
|
51
44
|
return () => sub.remove();
|
|
52
45
|
},
|
|
53
|
-
|
|
54
|
-
setOverlayContent(component: React.ComponentType | null): void {
|
|
55
|
-
registeredContent = component;
|
|
56
|
-
contentListeners.forEach((listener) => listener());
|
|
57
|
-
},
|
|
58
46
|
};
|
|
59
47
|
|
|
60
48
|
export default function NamiOverlayHost() {
|
|
61
|
-
const [Content, setContent] = useState<React.ComponentType | null>(
|
|
62
|
-
() => registeredContent,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const listener = () => setContent(() => registeredContent);
|
|
67
|
-
contentListeners.add(listener);
|
|
68
|
-
return () => {
|
|
69
|
-
contentListeners.delete(listener);
|
|
70
|
-
};
|
|
71
|
-
}, []);
|
|
72
|
-
|
|
73
|
-
if (Content) {
|
|
74
|
-
return <Content />;
|
|
75
|
-
}
|
|
76
49
|
return <View style={styles.overlay} />;
|
|
77
50
|
}
|
|
78
51
|
|
package/src/version.ts
CHANGED