react-native-nami-sdk 3.0.26 → 3.0.27
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 +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +1 -1
- package/ios/Nami.m +1 -1
- package/package.json +1 -1
- package/src/Nami.d.ts +1 -1
- package/src/NamiCampaignManager.d.ts +12 -15
- package/src/NamiEntitlementManager.ts +2 -8
- package/src/NamiPaywallManager.d.ts +32 -28
- package/src/NamiPaywallManager.ts +4 -4
package/android/build.gradle
CHANGED
|
@@ -84,7 +84,7 @@ dependencies {
|
|
|
84
84
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
85
85
|
|
|
86
86
|
implementation 'com.github.jeziellago:compose-markdown:0.3.0'
|
|
87
|
-
implementation "com.namiml:sdk-android:3.1.
|
|
87
|
+
implementation "com.namiml:sdk-android:3.1.1"
|
|
88
88
|
|
|
89
89
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
90
90
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
|
@@ -115,7 +115,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
115
115
|
} else {
|
|
116
116
|
Arguments.createArray()
|
|
117
117
|
}
|
|
118
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.
|
|
118
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.27")
|
|
119
119
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
120
120
|
settingsList.addAll(commandsFromReact)
|
|
121
121
|
}
|
package/ios/Nami.m
CHANGED
|
@@ -52,7 +52,7 @@ RCT_EXPORT_METHOD(configure: (NSDictionary *)configDict completion: (RCTResponse
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// Start commands with header iformation for Nami to let them know this is a React client.
|
|
55
|
-
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.0.
|
|
55
|
+
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.0.27"]];
|
|
56
56
|
|
|
57
57
|
// Add additional namiCommands app may have sent in.
|
|
58
58
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.27",
|
|
4
4
|
"description": "React Native Module for Nami - Easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
package/src/Nami.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { EmitterSubscription } from
|
|
2
|
-
import { NamiPurchase } from
|
|
3
|
-
import { NamiPaywallAction } from "./NamiPaywallManager";
|
|
4
|
-
import { NamiSKU } from "./types";
|
|
5
|
-
import { NamiPaywallAction, NamiPurchase } from "./types";
|
|
1
|
+
import { EmitterSubscription } from 'react-native';
|
|
2
|
+
import { NamiPaywallAction, NamiPurchase, NamiSKU } from './types';
|
|
6
3
|
|
|
7
4
|
export const NamiCampaignManager: {
|
|
8
5
|
allCampaigns: () => Promise<Array<NamiCampaign>>;
|
|
@@ -28,13 +25,13 @@ export const NamiCampaignManager: {
|
|
|
28
25
|
componentChangeId?: string,
|
|
29
26
|
componentChangeName?: string,
|
|
30
27
|
purchaseError?: string,
|
|
31
|
-
purchases?: NamiPurchase[]
|
|
32
|
-
) => void
|
|
28
|
+
purchases?: NamiPurchase[],
|
|
29
|
+
) => void,
|
|
33
30
|
) => void;
|
|
34
31
|
refresh: () => void;
|
|
35
32
|
registerAvailableCampaignsHandler: (
|
|
36
|
-
|
|
37
|
-
) => EmitterSubscription[
|
|
33
|
+
callback: (availableCampaigns: NamiCampaign[]) => void,
|
|
34
|
+
) => EmitterSubscription['remove'];
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
export type NamiCampaign = {
|
|
@@ -47,10 +44,10 @@ export type NamiCampaign = {
|
|
|
47
44
|
};
|
|
48
45
|
|
|
49
46
|
export enum NamiCampaignRule {
|
|
50
|
-
DEFAULT =
|
|
51
|
-
LABEL =
|
|
52
|
-
UNKNOWN =
|
|
53
|
-
URL =
|
|
47
|
+
DEFAULT = 'default',
|
|
48
|
+
LABEL = 'label',
|
|
49
|
+
UNKNOWN = 'unknown',
|
|
50
|
+
URL = 'url',
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
export enum LaunchCampaignError {
|
|
@@ -62,8 +59,8 @@ export enum LaunchCampaignError {
|
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
export enum LaunchCampaignResultAction {
|
|
65
|
-
FAILURE =
|
|
66
|
-
SUCCESS =
|
|
62
|
+
FAILURE = 'FAILURE',
|
|
63
|
+
SUCCESS = 'SUCCESS',
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
export type FailureResultObject = {
|
|
@@ -27,11 +27,7 @@ export interface INamiEntitlementManager {
|
|
|
27
27
|
export const NamiEntitlementManager: INamiEntitlementManager = {
|
|
28
28
|
...RNNamiEntitlementManager,
|
|
29
29
|
emitter: new NativeEventEmitter(RNNamiEntitlementManager),
|
|
30
|
-
refresh: (
|
|
31
|
-
resultCallback?: (
|
|
32
|
-
entitlements?: INamiEntitlementManager['NamiEntitlement'][],
|
|
33
|
-
) => void,
|
|
34
|
-
) => {
|
|
30
|
+
refresh: (resultCallback?: (entitlements?: NamiEntitlement[]) => void) => {
|
|
35
31
|
if (Platform.OS === 'android') {
|
|
36
32
|
RNNamiEntitlementManager.refresh(resultCallback ?? (() => {}));
|
|
37
33
|
} else {
|
|
@@ -39,9 +35,7 @@ export const NamiEntitlementManager: INamiEntitlementManager = {
|
|
|
39
35
|
}
|
|
40
36
|
},
|
|
41
37
|
registerActiveEntitlementsHandler: (
|
|
42
|
-
callback: (
|
|
43
|
-
activeEntitlements: INamiEntitlementManager['NamiEntitlement'][],
|
|
44
|
-
) => void,
|
|
38
|
+
callback: (activeEntitlements: NamiEntitlement[]) => void,
|
|
45
39
|
) => {
|
|
46
40
|
let subscription: EmitterSubscription =
|
|
47
41
|
NamiEntitlementManager.emitter.addListener(
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { EmitterSubscription } from
|
|
2
|
-
import { NamiSKU } from
|
|
1
|
+
import { EmitterSubscription } from 'react-native';
|
|
2
|
+
import { NamiSKU } from './types';
|
|
3
3
|
|
|
4
4
|
export const NamiPaywallManager: {
|
|
5
5
|
buySkuCompleteApple: (purchaseSuccess: NamiPurchaseSuccessApple) => void;
|
|
6
6
|
buySkuCompleteAmazon: (purchaseSuccess: NamiPurchaseSuccessAmazon) => void;
|
|
7
7
|
buySkuCompleteGooglePlay: (
|
|
8
|
-
purchaseSuccess: NamiPurchaseSuccessGooglePlay
|
|
8
|
+
purchaseSuccess: NamiPurchaseSuccessGooglePlay,
|
|
9
9
|
) => void;
|
|
10
10
|
dismiss: (animated?: boolean) => void;
|
|
11
11
|
registerBuySkuHandler: (
|
|
12
|
-
callback: (sku: NamiSKU) => void
|
|
13
|
-
) => EmitterSubscription[
|
|
14
|
-
registerCloseHandler: (callback: () => void) => EmitterSubscription[
|
|
15
|
-
registerSignInHandler: (
|
|
16
|
-
|
|
12
|
+
callback: (sku: NamiSKU) => void,
|
|
13
|
+
) => EmitterSubscription['remove'];
|
|
14
|
+
registerCloseHandler: (callback: () => void) => EmitterSubscription['remove'];
|
|
15
|
+
registerSignInHandler: (
|
|
16
|
+
callback: () => void,
|
|
17
|
+
) => EmitterSubscription['remove'];
|
|
18
|
+
registerRestoreHandler: (
|
|
19
|
+
callback: () => void,
|
|
20
|
+
) => EmitterSubscription['remove'];
|
|
17
21
|
show: () => void;
|
|
18
22
|
hide: () => void;
|
|
19
23
|
isHidden: () => Promise<boolean>;
|
|
@@ -37,14 +41,14 @@ export type NamiPurchaseSuccessGooglePlay = {
|
|
|
37
41
|
purchaseDate: number;
|
|
38
42
|
expiresDate?: number;
|
|
39
43
|
purchaseToken: string;
|
|
40
|
-
purchaseSource:
|
|
44
|
+
purchaseSource: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export type NamiPurchaseSuccessAmazon = {
|
|
44
48
|
product: NamiSKU;
|
|
45
49
|
purchaseDate: number;
|
|
46
50
|
expiresDate?: number;
|
|
47
|
-
purchaseSource:
|
|
51
|
+
purchaseSource: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
|
|
48
52
|
receiptId: string;
|
|
49
53
|
localizedPrice: string;
|
|
50
54
|
userId: string;
|
|
@@ -52,22 +56,22 @@ export type NamiPurchaseSuccessAmazon = {
|
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
export enum NamiPaywallAction {
|
|
55
|
-
BUY_SKU =
|
|
56
|
-
SELECT_SKU =
|
|
57
|
-
RESTORE_PURCHASES =
|
|
58
|
-
SIGN_IN =
|
|
59
|
-
CLOSE_PAYWALL =
|
|
60
|
-
SHOW_PAYWALL =
|
|
61
|
-
PURCHASE_SELECTED_SKU =
|
|
62
|
-
PURCHASE_SUCCESS =
|
|
63
|
-
PURCHASE_FAILED =
|
|
64
|
-
PURCHASE_CANCELLED =
|
|
65
|
-
PURCHASE_PENDING =
|
|
66
|
-
PURCHASE_UNKNOWN =
|
|
67
|
-
PURCHASE_DEFERRED =
|
|
68
|
-
DEEPLINK =
|
|
69
|
-
TOGGLE_CHANGE =
|
|
70
|
-
PAGE_CHANGE =
|
|
71
|
-
SLIDE_CHANGE =
|
|
72
|
-
UNKNOWN =
|
|
59
|
+
BUY_SKU = 'BUY_SKU',
|
|
60
|
+
SELECT_SKU = 'SELECT_SKU',
|
|
61
|
+
RESTORE_PURCHASES = 'RESTORE_PURCHASES',
|
|
62
|
+
SIGN_IN = 'SIGN_IN',
|
|
63
|
+
CLOSE_PAYWALL = 'CLOSE_PAYWALL',
|
|
64
|
+
SHOW_PAYWALL = 'SHOW_PAYWALL',
|
|
65
|
+
PURCHASE_SELECTED_SKU = 'PURCHASE_SELECTED_SKU',
|
|
66
|
+
PURCHASE_SUCCESS = 'PURCHASE_SUCCESS',
|
|
67
|
+
PURCHASE_FAILED = 'PURCHASE_FAILED',
|
|
68
|
+
PURCHASE_CANCELLED = 'PURCHASE_CANCELLED',
|
|
69
|
+
PURCHASE_PENDING = 'PURCHASE_PENDING',
|
|
70
|
+
PURCHASE_UNKNOWN = 'PURCHASE_UNKNOWN',
|
|
71
|
+
PURCHASE_DEFERRED = 'PURCHASE_DEFERRED',
|
|
72
|
+
DEEPLINK = 'DEEPLINK',
|
|
73
|
+
TOGGLE_CHANGE = 'TOGGLE_CHANGE',
|
|
74
|
+
PAGE_CHANGE = 'PAGE_CHANGE',
|
|
75
|
+
SLIDE_CHANGE = 'SLIDE_CHANGE',
|
|
76
|
+
UNKNOWN = 'UNKNOWN',
|
|
73
77
|
}
|
|
@@ -99,8 +99,8 @@ export const NamiPaywallManager: INamiPaywallManager = {
|
|
|
99
99
|
let subscription;
|
|
100
100
|
subscription = NamiPaywallManager.paywallEmitter.addListener(
|
|
101
101
|
NamiPaywallManagerEvents.PaywallSignInRequested,
|
|
102
|
-
|
|
103
|
-
callback(
|
|
102
|
+
() => {
|
|
103
|
+
callback();
|
|
104
104
|
},
|
|
105
105
|
);
|
|
106
106
|
RNNamiPaywallManager.registerSignInHandler();
|
|
@@ -115,8 +115,8 @@ export const NamiPaywallManager: INamiPaywallManager = {
|
|
|
115
115
|
let subscription;
|
|
116
116
|
subscription = NamiPaywallManager.paywallEmitter.addListener(
|
|
117
117
|
NamiPaywallManagerEvents.PaywallRestoreRequested,
|
|
118
|
-
|
|
119
|
-
callback(
|
|
118
|
+
() => {
|
|
119
|
+
callback();
|
|
120
120
|
},
|
|
121
121
|
);
|
|
122
122
|
RNNamiPaywallManager.registerRestoreHandler();
|