@screeb/react-native 2.2.1 → 3.0.0

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.
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.private_header_files = "ios/**/*.h"
18
18
 
19
- s.dependency "Screeb", '~> 2.2.1'
19
+ s.dependency "Screeb", '~> 3.0.2'
20
20
  s.dependency "React-Core"
21
21
  install_modules_dependencies(s)
22
22
  end
@@ -74,5 +74,5 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
74
74
  dependencies {
75
75
  implementation "com.facebook.react:react-android"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
- api "app.screeb.sdk:survey:2.2.9"
77
+ api "app.screeb.sdk:survey:3.0.0"
78
78
  }
@@ -27,7 +27,7 @@ class ScreebReactNativeModule(reactContext: ReactApplicationContext) :
27
27
  language: String?,
28
28
  promise: Promise
29
29
  ) {
30
- Screeb.setSecondarySDK("react-native", "2.2.1")
30
+ Screeb.setSecondarySDK("react-native", "3.0.0")
31
31
 
32
32
  val mapHooks: HashMap<String, Any>? = hooks?.let { readable ->
33
33
  hashMapOf<String, Any>().apply {
@@ -26,7 +26,7 @@ class ScreebReactNative: RCTEventEmitter {
26
26
  initOptions initOptions_: [String: Any]?,
27
27
  language language_: String?
28
28
  ) {
29
- Screeb.setSecondarySDK(name: "react-native", version: "2.2.1")
29
+ Screeb.setSecondarySDK(name: "react-native", version: "3.0.0")
30
30
  var mapHooks: [String: Any]? = nil
31
31
  if (hooks_ != nil) {
32
32
  mapHooks = [:]
@@ -43,15 +43,10 @@ class ScreebReactNative: RCTEventEmitter {
43
43
  }
44
44
  }
45
45
 
46
- var initOptions = InitOptions()
47
- initOptions_?.forEach{ option in
48
- if (option.key == "isDebugMode") {
49
- initOptions = InitOptions(isDebugMode: option.value as? Bool)
50
- }
51
- }
52
-
46
+ let initOptionsDict: NSDictionary = NSDictionary(dictionary: (initOptions_ ?? [:]).compactMapValues { $0 })
47
+ let initOptionsFinal = InitOptions(dict: initOptionsDict)
53
48
  DispatchQueue.main.async {
54
- Screeb.initSdk(context: nil, channelId: channelId, identity: userId_, visitorProperty: properties_ ?? [:], initOptions: initOptions, hooks: mapHooks, language: language_)
49
+ Screeb.initSdk(context: nil, channelId: channelId, identity: userId_, visitorProperty: properties_ ?? [:], initOptions: initOptionsFinal, hooks: mapHooks, language: language_)
55
50
  }
56
51
  }
57
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/react-native",
3
- "version": "2.2.1",
3
+ "version": "3.0.0",
4
4
  "description": "Continuous Product Discovery",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",