react-native-nami-sdk 3.0.28 → 3.0.30
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/nami/reactlibrary/NamiBridgeModule.kt +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt +5 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +5 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt +0 -1
- package/ios/Nami.m +1 -1
- package/ios/NamiEntitlementManagerBridge.m +2 -0
- package/ios/NamiEntitlementManagerBridge.swift +6 -1
- package/ios/NamiPaywallManagerBridge.m +2 -0
- package/ios/NamiPaywallManagerBridge.swift +7 -0
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
- package/src/NamiEntitlementManager.d.ts +1 -1
- package/src/NamiEntitlementManager.ts +1 -0
- package/src/NamiPaywallManager.d.ts +1 -0
- package/src/NamiPaywallManager.ts +3 -0
package/android/build.gradle
CHANGED
|
@@ -65,7 +65,7 @@ repositories {
|
|
|
65
65
|
mavenCentral()
|
|
66
66
|
// ref: https://www.baeldung.com/maven-local-repository
|
|
67
67
|
mavenLocal()
|
|
68
|
-
maven { url("https://packages.namiml.com/NamiSDK/
|
|
68
|
+
maven { url("https://packages.namiml.com/NamiSDK/Amazon/") }
|
|
69
69
|
maven { url 'https://jitpack.io' }
|
|
70
70
|
maven {
|
|
71
71
|
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
@@ -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
|
-
|
|
87
|
+
compileOnly "com.namiml:sdk-amazon:3.1.5"
|
|
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.30")
|
|
119
119
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
120
120
|
settingsList.addAll(commandsFromReact)
|
|
121
121
|
}
|
|
@@ -61,6 +61,11 @@ class NamiEntitlementManagerBridgeModule(reactContext: ReactApplicationContext)
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
@ReactMethod
|
|
65
|
+
fun clearProvisionalEntitlementGrants() {
|
|
66
|
+
NamiEntitlementManager.clearProvisionalEntitlementGrants()
|
|
67
|
+
}
|
|
68
|
+
|
|
64
69
|
@ReactMethod
|
|
65
70
|
fun addListener(eventName: String?) {
|
|
66
71
|
}
|
|
@@ -251,6 +251,11 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
251
251
|
promise.resolve(false)
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
@ReactMethod
|
|
255
|
+
fun buySkuCancel() {
|
|
256
|
+
NamiPaywallManager.buySkuCancel()
|
|
257
|
+
}
|
|
258
|
+
|
|
254
259
|
@ReactMethod
|
|
255
260
|
fun addListener(eventName: String?) {
|
|
256
261
|
}
|
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.30"]];
|
|
56
56
|
|
|
57
57
|
// Add additional namiCommands app may have sent in.
|
|
58
58
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
|
@@ -36,10 +36,10 @@ class RNNamiEntitlementManager: RCTEventEmitter {
|
|
|
36
36
|
let dictionary = RNNamiPurchaseManager.skuToSKUDict(sku)
|
|
37
37
|
return dictionary
|
|
38
38
|
}
|
|
39
|
+
|
|
39
40
|
let dictionary: [String: Any?] = [
|
|
40
41
|
"name": entitlement.name,
|
|
41
42
|
"desc": entitlement.desc,
|
|
42
|
-
"namiId": entitlement.namiId,
|
|
43
43
|
"referenceId": entitlement.referenceId,
|
|
44
44
|
"activePurchases": activePurchasesDict,
|
|
45
45
|
"relatedSkus": relatedSkusDict,
|
|
@@ -79,4 +79,9 @@ class RNNamiEntitlementManager: RCTEventEmitter {
|
|
|
79
79
|
RNNamiEntitlementManager.shared?.sendEvent(withName: "EntitlementsChanged", body: dictionaries)
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
@objc(clearProvisionalEntitlementGrants)
|
|
84
|
+
func clearProvisionalEntitlementGrants() {
|
|
85
|
+
NamiEntitlementManager.clearProvisionalEntitlementGrants()
|
|
86
|
+
}
|
|
82
87
|
}
|
|
@@ -130,6 +130,13 @@ class RNNamiPaywallManager: RCTEventEmitter {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
@objc(buySkuCancel)
|
|
134
|
+
func buySkuCancel() {
|
|
135
|
+
DispatchQueue.main.async {
|
|
136
|
+
NamiPaywallManager.buySkuCancel()
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
133
140
|
@objc(isHidden:rejecter:)
|
|
134
141
|
func isHidden(resolve: @escaping RCTPromiseResolveBlock, reject _: @escaping RCTPromiseRejectBlock) {
|
|
135
142
|
DispatchQueue.main.async {
|
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.30",
|
|
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",
|
|
@@ -10,13 +10,13 @@ export const NamiEntitlementManager: {
|
|
|
10
10
|
registerActiveEntitlementsHandler: (
|
|
11
11
|
callback: (activeEntitlements: NamiEntitlement[]) => void,
|
|
12
12
|
) => EmitterSubscription['remove'];
|
|
13
|
+
clearProvisionalEntitlementGrants: () => void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export type NamiEntitlement = {
|
|
16
17
|
activePurchases: NamiPurchase[];
|
|
17
18
|
desc: string;
|
|
18
19
|
name: string;
|
|
19
|
-
namiId: string;
|
|
20
20
|
purchasedSkus: NamiSKU[];
|
|
21
21
|
referenceId: string;
|
|
22
22
|
relatedSkus: NamiSKU[];
|
|
@@ -22,6 +22,7 @@ export interface INamiEntitlementManager {
|
|
|
22
22
|
registerActiveEntitlementsHandler: (
|
|
23
23
|
callback: (activeEntitlements: NamiEntitlement[]) => void,
|
|
24
24
|
) => EmitterSubscription['remove'];
|
|
25
|
+
clearProvisionalEntitlementGrants: () => void;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export const NamiEntitlementManager: INamiEntitlementManager = {
|
|
@@ -65,6 +65,9 @@ export const NamiPaywallManager: INamiPaywallManager = {
|
|
|
65
65
|
ServicesEnum.GooglePlay,
|
|
66
66
|
);
|
|
67
67
|
},
|
|
68
|
+
buySkuCancel: () => {
|
|
69
|
+
RNNamiPaywallManager.buySkuCancel();
|
|
70
|
+
},
|
|
68
71
|
registerBuySkuHandler: (callback: (sku: NamiSKU) => void) => {
|
|
69
72
|
let subscription;
|
|
70
73
|
subscription = NamiPaywallManager.paywallEmitter.addListener(
|