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.
@@ -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/Android/") }
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
- implementation "com.namiml:sdk-android:3.1.2"
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.28")
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
  }
@@ -143,7 +143,6 @@ fun NamiEntitlement.toEntitlementDict(): WritableMap? {
143
143
  return null
144
144
  }
145
145
 
146
- resultMap.putString("namiId", namiId.orEmpty())
147
146
  resultMap.putString("desc", desc.orEmpty())
148
147
  resultMap.putString("name", name.orEmpty())
149
148
 
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.28"]];
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"];
@@ -18,6 +18,8 @@ RCT_EXTERN_METHOD(refresh)
18
18
 
19
19
  RCT_EXTERN_METHOD(registerActiveEntitlementsHandler)
20
20
 
21
+ RCT_EXTERN_METHOD(clearProvisionalEntitlementGrants)
22
+
21
23
  + (BOOL)requiresMainQueueSetup {
22
24
  return YES;
23
25
  }
@@ -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
  }
@@ -33,6 +33,8 @@ RCT_EXTERN_METHOD(hide)
33
33
 
34
34
  RCT_EXTERN_METHOD(isHidden:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
35
35
 
36
+ RCT_EXTERN_METHOD(buySkuCancel)
37
+
36
38
  + (BOOL)requiresMainQueueSetup {
37
39
  return YES;
38
40
  }
@@ -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.28",
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",
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
20
20
  s.source_files = "ios/**/*.{h,m,swift}"
21
21
  s.requires_arc = true
22
22
 
23
- s.dependency 'Nami', '3.1.3'
23
+ s.dependency 'Nami', '3.1.6'
24
24
  s.dependency 'React'
25
25
 
26
26
  end
@@ -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 = {
@@ -20,6 +20,7 @@ export const NamiPaywallManager: {
20
20
  ) => EmitterSubscription['remove'];
21
21
  show: () => void;
22
22
  hide: () => void;
23
+ buySkuCancel: () => void;
23
24
  isHidden: () => Promise<boolean>;
24
25
  };
25
26
 
@@ -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(