react-native-nami-sdk 3.1.21 → 3.1.22
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/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +7 -3
- package/index.ts +1 -0
- package/ios/Nami.m +1 -1
- package/ios/NamiPaywallManagerBridge.m +1 -1
- package/ios/NamiPaywallManagerBridge.swift +8 -3
- package/package.json +1 -1
- package/src/NamiPaywallManager.d.ts +1 -1
- package/src/NamiPaywallManager.ts +3 -3
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
|
-
compileOnly "com.namiml:sdk-amazon:3.1.
|
|
87
|
+
compileOnly "com.namiml:sdk-amazon:3.1.22"
|
|
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"
|
|
@@ -106,7 +106,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
106
106
|
} else {
|
|
107
107
|
Arguments.createArray()
|
|
108
108
|
}
|
|
109
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:3.1.
|
|
109
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:3.1.22")
|
|
110
110
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
111
111
|
settingsList.addAll(commandsFromReact)
|
|
112
112
|
}
|
|
@@ -129,10 +129,12 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@ReactMethod
|
|
132
|
-
fun dismiss(
|
|
132
|
+
fun dismiss(promise: Promise) {
|
|
133
133
|
if (latestPaywallActivity != null) {
|
|
134
134
|
val paywallActivity = latestPaywallActivity as Activity
|
|
135
|
-
NamiPaywallManager.dismiss(paywallActivity
|
|
135
|
+
NamiPaywallManager.dismiss(paywallActivity, completionHandler = {
|
|
136
|
+
promise.resolve(it)
|
|
137
|
+
})
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
140
|
|
|
@@ -207,7 +209,9 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
207
209
|
|
|
208
210
|
@ReactMethod
|
|
209
211
|
fun buySkuCancel() {
|
|
210
|
-
|
|
212
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
213
|
+
NamiPaywallManager.buySkuCancel()
|
|
214
|
+
}
|
|
211
215
|
}
|
|
212
216
|
|
|
213
217
|
@ReactMethod
|
package/index.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { NamiEntitlementManager } from './src/NamiEntitlementManager';
|
|
|
6
6
|
export { NamiManager } from './src/NamiManager';
|
|
7
7
|
export { NamiPurchaseManager } from './src/NamiPurchaseManager';
|
|
8
8
|
export { NamiPaywallManager } from './src/NamiPaywallManager';
|
|
9
|
+
export { NamiSKU } from './src/types';
|
|
9
10
|
export * from './src/types';
|
package/ios/Nami.m
CHANGED
|
@@ -50,7 +50,7 @@ RCT_EXPORT_METHOD(configure: (NSDictionary *)configDict completion: (RCTResponse
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Start commands with header iformation for Nami to let them know this is a React client.
|
|
53
|
-
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.1.
|
|
53
|
+
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.1.22"]];
|
|
54
54
|
|
|
55
55
|
// Add additional namiCommands app may have sent in.
|
|
56
56
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
|
@@ -27,7 +27,7 @@ RCT_EXTERN_METHOD(registerRestoreHandler)
|
|
|
27
27
|
|
|
28
28
|
RCT_EXTERN_METHOD(registerDeeplinkActionHandler)
|
|
29
29
|
|
|
30
|
-
RCT_EXTERN_METHOD(dismiss:(
|
|
30
|
+
RCT_EXTERN_METHOD(dismiss:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
31
31
|
|
|
32
32
|
RCT_EXTERN_METHOD(show)
|
|
33
33
|
|
|
@@ -107,9 +107,14 @@ class RNNamiPaywallManager: RCTEventEmitter {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
@objc(dismiss:)
|
|
111
|
-
func dismiss(
|
|
112
|
-
|
|
110
|
+
@objc(dismiss:rejecter:)
|
|
111
|
+
func dismiss(resolve: @escaping RCTPromiseResolveBlock, reject _: @escaping RCTPromiseRejectBlock) {
|
|
112
|
+
DispatchQueue.main.async {
|
|
113
|
+
NamiPaywallManager.dismiss(animated: true) {
|
|
114
|
+
// move resolve into here when 3.1.23 is released
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
resolve(true)
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
@objc(show)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.22",
|
|
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",
|
|
@@ -7,7 +7,7 @@ export const NamiPaywallManager: {
|
|
|
7
7
|
buySkuCompleteGooglePlay: (
|
|
8
8
|
purchaseSuccess: NamiPurchaseSuccessGooglePlay,
|
|
9
9
|
) => void;
|
|
10
|
-
dismiss: (
|
|
10
|
+
dismiss: () => Promise<boolean>;
|
|
11
11
|
registerBuySkuHandler: (
|
|
12
12
|
callback: (sku: NamiSKU) => void,
|
|
13
13
|
) => EmitterSubscription['remove'];
|
|
@@ -44,7 +44,7 @@ export interface INamiPaywallManager {
|
|
|
44
44
|
registerDeeplinkActionHandler: (
|
|
45
45
|
callback: (url: string) => void,
|
|
46
46
|
) => EmitterSubscription['remove'];
|
|
47
|
-
dismiss: (
|
|
47
|
+
dismiss: () => Promise<boolean>;
|
|
48
48
|
show: () => void;
|
|
49
49
|
hide: () => void;
|
|
50
50
|
isHidden: () => Promise<boolean>;
|
|
@@ -145,8 +145,8 @@ export const NamiPaywallManager: INamiPaywallManager = {
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
},
|
|
148
|
-
dismiss: (
|
|
149
|
-
RNNamiPaywallManager.dismiss(
|
|
148
|
+
dismiss: () => {
|
|
149
|
+
return RNNamiPaywallManager.dismiss();
|
|
150
150
|
},
|
|
151
151
|
show: () => {
|
|
152
152
|
RNNamiPaywallManager.show();
|