react-native-nami-sdk 3.1.34 → 3.1.36

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.
@@ -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.32"
87
+ compileOnly "com.namiml:sdk-amazon:3.1.34"
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.34")
109
+ val settingsList = mutableListOf("extendedClientInfo:react-native:3.1.36")
110
110
  namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
111
111
  settingsList.addAll(commandsFromReact)
112
112
  }
@@ -220,6 +220,11 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
220
220
  }
221
221
  }
222
222
 
223
+ @ReactMethod
224
+ fun setProductDetails(productDetails: String, allowOffers: Boolean) {
225
+ NamiPaywallManager.setProductDetails(productDetails, allowOffers = allowOffers)
226
+ }
227
+
223
228
  @ReactMethod
224
229
  fun addListener(eventName: String?) {
225
230
  }
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.34"]];
53
+ NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.1.36"]];
54
54
 
55
55
  // Add additional namiCommands app may have sent in.
56
56
  NSObject *appCommandStrings = configDict[@"namiCommands"];
@@ -39,6 +39,9 @@ RCT_EXTERN_METHOD(isPaywallOpen:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
39
39
 
40
40
  RCT_EXTERN_METHOD(buySkuCancel)
41
41
 
42
+ RCT_EXTERN_METHOD(setProductDetails:(NSString *)productDetails allowOffers:(BOOL *))
43
+
44
+
42
45
  + (BOOL)requiresMainQueueSetup {
43
46
  return YES;
44
47
  }
@@ -152,4 +152,9 @@ class RNNamiPaywallManager: RCTEventEmitter {
152
152
  resolve(isPaywallOpen)
153
153
  }
154
154
  }
155
+
156
+ @objc(setProductDetails:allowOffers:)
157
+ func setProductDetails(productDetails: String, allowOffers: Bool) {
158
+ // Do nothing on Apple
159
+ }
155
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nami-sdk",
3
- "version": "3.1.34",
3
+ "version": "3.1.36",
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",
@@ -26,6 +26,7 @@ export const NamiPaywallManager: {
26
26
  buySkuCancel: () => void;
27
27
  isHidden: () => Promise<boolean>;
28
28
  isPaywallOpen: () => Promise<boolean>;
29
+ setProductDetails: (productDetails: string, allowOffers: boolean) => void;
29
30
  };
30
31
 
31
32
  export type NamiPurchaseSuccessApple = {
@@ -49,6 +49,7 @@ export interface INamiPaywallManager {
49
49
  hide: () => void;
50
50
  isHidden: () => Promise<boolean>;
51
51
  isPaywallOpen: () => Promise<boolean>;
52
+ setProductDetails: (productDetails: string, allowOffers: boolean) => void;
52
53
  }
53
54
 
54
55
  const { NamiPaywallManagerBridge, RNNamiPaywallManager } = NativeModules;
@@ -160,4 +161,13 @@ export const NamiPaywallManager: INamiPaywallManager = {
160
161
  isPaywallOpen: () => {
161
162
  return RNNamiPaywallManager.isPaywallOpen();
162
163
  },
164
+ setProductDetails: (
165
+ productDetails: string,
166
+ allowOffers: boolean
167
+ ) => {
168
+ RNNamiPaywallManager.setProductDetails(
169
+ productDetails,
170
+ allowOffers,
171
+ );
172
+ },
163
173
  };