@screeb/react-native 2.1.14 → 2.1.15

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.
@@ -28,7 +28,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
28
28
  @ReactMethod
29
29
  fun initSdk(channelId: String, userId: String?, properties: ReadableMap?, hooks: ReadableMap?, initOptions: ReadableMap?, language: String?) {
30
30
  Log.d("ScreebModule", "Called initSdk : $userId")
31
- Screeb.setSecondarySDK("react-native", "2.1.14")
31
+ Screeb.setSecondarySDK("react-native", "2.1.15")
32
32
  var mapHooks:HashMap<String, Any>? = null
33
33
  if (hooks != null) {
34
34
  mapHooks = hashMapOf<String, Any>()
@@ -48,7 +48,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
48
48
  }
49
49
 
50
50
  Handler(Looper.getMainLooper()).post {
51
- Screeb.pluginInit(channelId, userId, fromReadableMap(properties), mapHooks, language)
51
+ Screeb.pluginInit(channelId, userId, this.fromReadableMap(properties), mapHooks, language)
52
52
  }
53
53
  }
54
54
 
@@ -56,7 +56,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
56
56
  fun setIdentity(userId: String, properties: ReadableMap?) {
57
57
  Log.d("ScreebModule", "Called setIdentity : $userId")
58
58
  Handler(Looper.getMainLooper()).post {
59
- Screeb.setIdentity(userId, fromReadableMap(properties))
59
+ Screeb.setIdentity(userId, this.fromReadableMap(properties))
60
60
  }
61
61
  }
62
62
 
@@ -64,7 +64,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
64
64
  fun setProperties(properties: ReadableMap?) {
65
65
  Log.d("ScreebModule", "Called setProperties")
66
66
  Handler(Looper.getMainLooper()).post {
67
- Screeb.setVisitorProperties(fromReadableMap(properties))
67
+ Screeb.setVisitorProperties(this.fromReadableMap(properties))
68
68
  }
69
69
  }
70
70
 
@@ -72,7 +72,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
72
72
  fun assignGroup(type: String? = null, name: String, properties: ReadableMap? = null) {
73
73
  Log.d("ScreebModule", "Called assignGroup : $name")
74
74
  Handler(Looper.getMainLooper()).post {
75
- Screeb.assignGroup(type, name, fromReadableMap(properties))
75
+ Screeb.assignGroup(type, name, this.fromReadableMap(properties))
76
76
  }
77
77
  }
78
78
 
@@ -80,7 +80,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
80
80
  fun unassignGroup(type: String? = null, name: String, properties: ReadableMap? = null) {
81
81
  Log.d("ScreebModule", "Called unassignGroup : $name")
82
82
  Handler(Looper.getMainLooper()).post {
83
- Screeb.unassignGroup(type, name, fromReadableMap(properties))
83
+ Screeb.unassignGroup(type, name, this.fromReadableMap(properties))
84
84
  }
85
85
  }
86
86
 
@@ -88,7 +88,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
88
88
  fun trackEvent(eventId: String, properties: ReadableMap?) {
89
89
  Log.d("ScreebModule", "Called trackEvent : $eventId")
90
90
  Handler(Looper.getMainLooper()).post {
91
- Screeb.trackEvent(eventId, fromReadableMap(properties))
91
+ Screeb.trackEvent(eventId, this.fromReadableMap(properties))
92
92
  }
93
93
  }
94
94
 
@@ -96,7 +96,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
96
96
  fun trackScreen(screen: String, properties: ReadableMap?) {
97
97
  Log.d("ScreebModule", "Called trackScreen : $screen")
98
98
  Handler(Looper.getMainLooper()).post {
99
- Screeb.trackScreen(screen, fromReadableMap(properties))
99
+ Screeb.trackScreen(screen, this.fromReadableMap(properties))
100
100
  }
101
101
  }
102
102
 
@@ -121,7 +121,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
121
121
  }
122
122
  }
123
123
  Handler(Looper.getMainLooper()).post {
124
- Screeb.startSurvey(surveyId, allowMultipleResponses ?: true, fromReadableMap(hiddenFields), ignoreSurveyStatus ?: true, mapHooks, language)
124
+ Screeb.startSurvey(surveyId, allowMultipleResponses ?: true, this.fromReadableMap(hiddenFields), ignoreSurveyStatus ?: true, mapHooks, language)
125
125
  }
126
126
  }
127
127
 
@@ -152,7 +152,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
152
152
  @ReactMethod
153
153
  fun onHookResult(hookId: String, payload: ReadableMap?){
154
154
  if (payload != null) {
155
- val result = fromReadableMap(payload!!)!!["result"] as Any?
155
+ val result = this.fromReadableMap(payload!!)!!["result"] as Any?
156
156
  Screeb.onHookResult(hookId, result)
157
157
  }
158
158
  }
@@ -175,16 +175,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
175
175
  if (readableMap == null) {
176
176
  return null
177
177
  }
178
- val map = HashMap<String, Any?>()
179
- val keys = readableMap.keySetIterator()
180
- while (keys.hasNextKey()) {
181
- val key = keys.nextKey()
182
- when (val value = readableMap.getValue(key)) {
183
- is ReadableMap -> map[key] = fromReadableMap(value)
184
- is ReadableArray -> map[key] = fromReadableArray(value)
185
- else -> map[key] = value
186
- }
187
- }
188
- return map
178
+
179
+ return readableMap!!.toHashMap() as HashMap<String, Any?>?
189
180
  }
190
181
  }
@@ -13,7 +13,7 @@ class ScreebModule: RCTEventEmitter {
13
13
  initOptions initOptions_: [String: Any]?,
14
14
  language language_: String?
15
15
  ) {
16
- Screeb.setSecondarySDK(name: "react-native", version: "2.1.14")
16
+ Screeb.setSecondarySDK(name: "react-native", version: "2.1.15")
17
17
  var map: [String: AnyEncodable?] = [:]
18
18
  if (properties_ != nil) {
19
19
  map = self.mapToAnyEncodable(map: properties_!)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/react-native",
3
- "version": "2.1.14",
3
+ "version": "2.1.15",
4
4
  "description": "Continuous Product Discovery",
5
5
  "scripts": {
6
6
  "clean": "rm -rf lib/",