react-native-nami-sdk 3.3.5 → 3.3.6-2
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 +2 -2
- package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +4 -2
- package/dist/specs/NativeNamiCampaignManager.d.ts +5 -1
- package/dist/specs/NativeNamiPaywallManager.d.ts +1 -1
- package/dist/src/NamiCampaignManager.d.ts +2 -2
- package/dist/src/types.d.ts +5 -0
- package/dist/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
- package/specs/NativeNamiCampaignManager.ts +4 -1
- package/specs/NativeNamiPaywallManager.ts +1 -1
- package/src/NamiCampaignManager.ts +2 -1
- package/src/types.ts +6 -0
- package/src/version.ts +1 -1
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.3.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.3.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.3.6.2"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.3.6.2"
|
|
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"
|
|
@@ -68,7 +68,7 @@ class NamiPaywallManagerBridgeModule internal constructor(
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (purchaseSuccess != null) {
|
|
71
|
-
val activity = latestPaywallActivity ?:
|
|
71
|
+
val activity = latestPaywallActivity ?: reactApplicationContext.getCurrentActivity()
|
|
72
72
|
if (activity != null) {
|
|
73
73
|
NamiPaywallManager.buySkuComplete(activity, purchaseSuccess)
|
|
74
74
|
} else {
|
|
@@ -83,6 +83,8 @@ class NamiPaywallManagerBridgeModule internal constructor(
|
|
|
83
83
|
@ReactMethod
|
|
84
84
|
fun registerCloseHandler() {
|
|
85
85
|
NamiPaywallManager.registerCloseHandler { activity ->
|
|
86
|
+
Log.d(NAME, "close handler called, latestPaywallActivity: $activity")
|
|
87
|
+
|
|
86
88
|
latestPaywallActivity = activity
|
|
87
89
|
val map = Arguments.createMap().apply {
|
|
88
90
|
putBoolean("paywallCloseRequested", true)
|
|
@@ -166,7 +168,7 @@ class NamiPaywallManagerBridgeModule internal constructor(
|
|
|
166
168
|
reactApplicationContext.runOnUiQueueThread {
|
|
167
169
|
latestPaywallActivity?.let {
|
|
168
170
|
NamiPaywallManager.buySkuCancel(it)
|
|
169
|
-
} ?:
|
|
171
|
+
} ?: reactApplicationContext.getCurrentActivity()?.let {
|
|
170
172
|
NamiPaywallManager.buySkuCancel(it)
|
|
171
173
|
} ?: NamiPaywallManager.buySkuCancel()
|
|
172
174
|
}
|
|
@@ -8,7 +8,11 @@ export interface Spec extends TurboModule {
|
|
|
8
8
|
customObject?: {
|
|
9
9
|
[key: string]: unknown;
|
|
10
10
|
};
|
|
11
|
-
} | null, completion: (successAction: boolean, error:
|
|
11
|
+
} | null, completion: (successAction: boolean, error: {
|
|
12
|
+
domain: string;
|
|
13
|
+
code: number;
|
|
14
|
+
message: string;
|
|
15
|
+
} | null) => void, paywallCompletion: (event: {
|
|
12
16
|
campaignId?: string;
|
|
13
17
|
campaignName?: string;
|
|
14
18
|
campaignType?: string;
|
|
@@ -58,7 +58,7 @@ export interface Spec extends TurboModule {
|
|
|
58
58
|
registerSignInHandler(): void;
|
|
59
59
|
registerRestoreHandler(): void;
|
|
60
60
|
registerDeeplinkActionHandler(): void;
|
|
61
|
-
dismiss(): Promise<
|
|
61
|
+
dismiss(): Promise<boolean>;
|
|
62
62
|
show(): void;
|
|
63
63
|
hide(): void;
|
|
64
64
|
isHidden(): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
|
-
import type { PaywallLaunchContext, NamiCampaign } from './types';
|
|
2
|
+
import type { PaywallLaunchContext, NamiCampaign, NamiError } from './types';
|
|
3
3
|
export declare enum NamiCampaignManagerEvents {
|
|
4
4
|
AvailableCampaignsChanged = "AvailableCampaignsChanged",
|
|
5
5
|
NamiPaywallEvent = "NamiPaywallEvent"
|
|
@@ -7,7 +7,7 @@ export declare enum NamiCampaignManagerEvents {
|
|
|
7
7
|
export declare const NamiCampaignManager: {
|
|
8
8
|
emitter: NativeEventEmitter;
|
|
9
9
|
launchSubscription: ReturnType<NativeEventEmitter["addListener"]> | undefined;
|
|
10
|
-
launch(label: string | null, withUrl: string | null, context: PaywallLaunchContext | null, resultCallback?: (success: boolean,
|
|
10
|
+
launch(label: string | null, withUrl: string | null, context: PaywallLaunchContext | null, resultCallback?: (success: boolean, error?: NamiError | null) => void, actionCallback?: (event: any) => void): void;
|
|
11
11
|
allCampaigns: () => Promise<{
|
|
12
12
|
id?: string;
|
|
13
13
|
rule?: string;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -80,6 +80,11 @@ export declare enum LaunchCampaignError {
|
|
|
80
80
|
PRODUCT_DATA_NOT_FOUND = 7,
|
|
81
81
|
PRODUCT_GROUPS_NOT_FOUND = 8
|
|
82
82
|
}
|
|
83
|
+
export type NamiError = {
|
|
84
|
+
domain: string;
|
|
85
|
+
code: number;
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
83
88
|
export declare enum LaunchCampaignResultAction {
|
|
84
89
|
FAILURE = "FAILURE",
|
|
85
90
|
SUCCESS = "SUCCESS"
|
package/dist/src/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -10,7 +10,10 @@ export interface Spec extends TurboModule {
|
|
|
10
10
|
customAttributes?: { [key: string]: string };
|
|
11
11
|
customObject?: { [key: string]: unknown };
|
|
12
12
|
} | null,
|
|
13
|
-
completion: (
|
|
13
|
+
completion: (
|
|
14
|
+
successAction: boolean,
|
|
15
|
+
error: { domain: string; code: number; message: string } | null,
|
|
16
|
+
) => void,
|
|
14
17
|
paywallCompletion: (event: {
|
|
15
18
|
campaignId?: string;
|
|
16
19
|
campaignName?: string;
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
NamiPaywallEvent,
|
|
9
9
|
PaywallLaunchContext,
|
|
10
10
|
NamiCampaign,
|
|
11
|
+
NamiError,
|
|
11
12
|
} from './types';
|
|
12
13
|
import { NamiPaywallAction } from './types';
|
|
13
14
|
|
|
@@ -43,7 +44,7 @@ export const NamiCampaignManager = {
|
|
|
43
44
|
label: string | null,
|
|
44
45
|
withUrl: string | null,
|
|
45
46
|
context: PaywallLaunchContext | null,
|
|
46
|
-
resultCallback?: (success: boolean,
|
|
47
|
+
resultCallback?: (success: boolean, error?: NamiError | null) => void,
|
|
47
48
|
actionCallback?: (event: any) => void,
|
|
48
49
|
): void {
|
|
49
50
|
if (this.launchSubscription) {
|
package/src/types.ts
CHANGED
|
@@ -188,6 +188,12 @@ export enum LaunchCampaignError {
|
|
|
188
188
|
PRODUCT_GROUPS_NOT_FOUND = 8,
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
export type NamiError = {
|
|
192
|
+
domain: string;
|
|
193
|
+
code: number;
|
|
194
|
+
message: string;
|
|
195
|
+
};
|
|
196
|
+
|
|
191
197
|
export enum LaunchCampaignResultAction {
|
|
192
198
|
FAILURE = 'FAILURE',
|
|
193
199
|
SUCCESS = 'SUCCESS',
|
package/src/version.ts
CHANGED