@identomat-inc/react-native-identomat 1.0.32 → 1.0.34

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.
@@ -43,6 +43,6 @@ dependencies {
43
43
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
44
44
  // implementation 'com.android.support:recyclerview-v7:28.0.0'
45
45
  implementation 'com.android.support:design:28.0.0'
46
- implementation 'com.identomat:identomat-sdk:1.1.76-slim'
46
+ implementation 'com.identomat:identomat-sdk:1.1.81'
47
47
  implementation 'androidx.fragment:fragment:1.1.0-alpha05'
48
48
  }
@@ -75,6 +75,22 @@ public class BridgeModule extends ReactContextBaseJavaModule {
75
75
  e.printStackTrace();
76
76
  }
77
77
  }
78
+
79
+ @ReactMethod
80
+ public void setVariables(String variablesString){
81
+ try {
82
+ JSONObject variablesObj=new JSONObject(variablesString);
83
+ Iterator<String> keys = variablesObj.keys();
84
+ HashMap<String, Object> variables = new HashMap<String, Object>();
85
+ while(keys.hasNext()) {
86
+ String key = keys.next();
87
+ variables.put(key, variablesObj.getInt(key));
88
+ }
89
+ identomatSDK.setVariables(variables);
90
+ } catch (JSONException e) {
91
+ e.printStackTrace();
92
+ }
93
+ }
78
94
  @ReactMethod
79
95
  public void setStrings(String strings){
80
96
  try {
package/index.js CHANGED
@@ -22,6 +22,13 @@ class Identomat {
22
22
  NativeModules.Identomat.setColors(JSON.stringify(colors));
23
23
  }
24
24
  }
25
+ async setVariables(variables) {
26
+ if(Platform.OS == "android"){
27
+ NativeModules.BridgeModule.setVariables(JSON.stringify(variables));
28
+ }else if(Platform.OS == "ios"){
29
+ NativeModules.Identomat.setVariables(JSON.stringify(variables));
30
+ }
31
+ }
25
32
  async setStrings(strings) {
26
33
  if(Platform.OS == "android"){
27
34
  NativeModules.BridgeModule.setStrings(JSON.stringify(strings));
package/ios/Identomat.m CHANGED
@@ -23,6 +23,7 @@ RCT_EXTERN_METHOD(start: (NSString *)sessionId)
23
23
  RCT_EXTERN_METHOD(setBaseUrl: (NSString *)baseUrl)
24
24
  RCT_EXTERN_METHOD(setColors: (NSString *)colors)
25
25
  RCT_EXTERN_METHOD(setStrings: (NSString *)strings)
26
+ RCT_EXTERN_METHOD(setVariables: (NSString *)variables)
26
27
  RCT_EXTERN_METHOD(callback: (RCTResponseSenderBlock *)successCallback)
27
28
  @end
28
29
 
@@ -48,6 +48,12 @@ class Identomat: NSObject, RCTBridgeModule{
48
48
  IdentomatManager.getInstance().setColors(color: colorsObj)
49
49
  }
50
50
  @objc
51
+ func setVariables(_ variables : String) -> Void {
52
+ let data: Data? = variables.data(using: .utf8)
53
+ let variablesObj = (try? JSONSerialization.jsonObject(with: data!, options: [])) as! [String:Any]
54
+ IdentomatManager.getInstance().setVariables(variables: variablesObj)
55
+ }
56
+ @objc
51
57
  func setStrings(_ strings : String) -> Void {
52
58
  let data: Data? = strings.data(using: .utf8)
53
59
  let stringsObj = (try? JSONSerialization.jsonObject(with: data!, options: [])) as! [String:Any]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@identomat-inc/react-native-identomat",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "identomat bridge module",
5
5
  "main": "index.js",
6
6
  "scripts": {