@screeb/react-native 2.0.19 → 2.0.21
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
CHANGED
|
@@ -123,6 +123,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
123
123
|
dependencies {
|
|
124
124
|
// noinspection GradleDynamicVersion
|
|
125
125
|
api 'com.facebook.react:react-native:+'
|
|
126
|
-
implementation "app.screeb.sdk:survey:2.0.
|
|
126
|
+
implementation "app.screeb.sdk:survey:2.0.28"
|
|
127
127
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22"
|
|
128
128
|
}
|
|
@@ -28,6 +28,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
|
|
|
28
28
|
@ReactMethod
|
|
29
29
|
fun initSdk(channelId: String, userId: String?, properties: ReadableMap?, hooks: ReadableMap?, initOptions: ReadableMap?) {
|
|
30
30
|
Log.d("ScreebModule", "Called initSdk : $userId")
|
|
31
|
+
Screeb.setSecondarySDK("react-native", "2.0.20")
|
|
31
32
|
var map: HashMap<String, Any?>? = null
|
|
32
33
|
if (properties != null) {
|
|
33
34
|
map = properties.toHashMap()
|
package/ios/ScreebModule.swift
CHANGED
|
@@ -11,6 +11,7 @@ class ScreebModule: RCTEventEmitter {
|
|
|
11
11
|
properties properties_: [String: Any]?,
|
|
12
12
|
hooks hooks_: [String: Any]?,
|
|
13
13
|
initOptions initOptions_: [String: Any]?) {
|
|
14
|
+
Screeb.setSecondarySDK(name: "react-native", version: "2.0.20")
|
|
14
15
|
var map: [String: AnyEncodable?] = [:]
|
|
15
16
|
if (properties_ != nil) {
|
|
16
17
|
map = self.mapToAnyEncodable(map: properties_!)
|
|
@@ -148,22 +149,30 @@ class ScreebModule: RCTEventEmitter {
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
private func mapToAnyEncodable(map: [String: Any]) -> [String: AnyEncodable?] {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
152
|
+
private func mapToAnyEncodable(map: [String: Any?]?) -> [String: AnyEncodable?] {
|
|
153
|
+
var anyEncodableMap: [String: AnyEncodable?] = [:]
|
|
154
|
+
map?.forEach { key, value in
|
|
155
|
+
if let nsValue = value as? NSNumber {
|
|
156
|
+
if CFBooleanGetTypeID() == CFGetTypeID(nsValue) {
|
|
157
|
+
anyEncodableMap[key] = AnyEncodable(nsValue.boolValue)
|
|
158
|
+
} else if let value = value as? Int {
|
|
159
|
+
anyEncodableMap[key] = AnyEncodable(value)
|
|
160
|
+
} else if let value = value as? Double {
|
|
161
|
+
anyEncodableMap[key] = AnyEncodable(value)
|
|
162
|
+
} else if let value = value as? Float {
|
|
163
|
+
anyEncodableMap[key] = AnyEncodable(value)
|
|
164
|
+
} else {
|
|
165
|
+
anyEncodableMap[key] = nil
|
|
166
|
+
}
|
|
167
|
+
} else if let value = value as? String {
|
|
168
|
+
anyEncodableMap[key] = AnyEncodable(value)
|
|
169
|
+
} else if let value = value as? [String: Any?] {
|
|
170
|
+
anyEncodableMap[key] = AnyEncodable(self.mapToAnyEncodable(map: value))
|
|
171
|
+
} else {
|
|
172
|
+
anyEncodableMap[key] = nil
|
|
173
|
+
}
|
|
166
174
|
}
|
|
175
|
+
return anyEncodableMap
|
|
167
176
|
}
|
|
168
177
|
|
|
169
178
|
override func supportedEvents() -> [String]! {
|
package/package.json
CHANGED
package/screeb-module.podspec
CHANGED