@screeb/react-native 2.0.7 → 2.0.9

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.
@@ -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.24"
126
+ implementation "app.screeb.sdk:survey:2.0.25"
127
127
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22"
128
128
  }
@@ -14,8 +14,6 @@ import androidx.annotation.NonNull
14
14
  import android.content.Context
15
15
  import android.util.Log
16
16
  import app.screeb.sdk.Screeb
17
- import android.os.Handler
18
- import android.os.Looper
19
17
 
20
18
  class ScreebModuleModule(reactContext: ReactApplicationContext) :
21
19
  ReactContextBaseJavaModule(reactContext) {
@@ -48,9 +46,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
48
46
  }
49
47
  }
50
48
  }
51
- Handler(Looper.getMainLooper()).post {
52
- Screeb.pluginInit(channelId, userId, map, mapHooks)
53
- }
49
+ Screeb.pluginInit(channelId, userId, map, mapHooks)
54
50
  }
55
51
 
56
52
  @ReactMethod
@@ -60,9 +56,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
60
56
  if (properties != null) {
61
57
  map = properties.toHashMap()
62
58
  }
63
- Handler(Looper.getMainLooper()).post {
64
- Screeb.setIdentity(userId, map)
65
- }
59
+ Screeb.setIdentity(userId, map)
66
60
  }
67
61
 
68
62
  @ReactMethod
@@ -71,9 +65,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
71
65
  "ScreebModule",
72
66
  "Called setVisitorProperties with " + properties.toHashMap().size + " properties"
73
67
  )
74
- Handler(Looper.getMainLooper()).post {
75
- Screeb.setVisitorProperties(properties.toHashMap())
76
- }
68
+ Screeb.setVisitorProperties(properties.toHashMap())
77
69
  }
78
70
 
79
71
  @ReactMethod
@@ -83,9 +75,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
83
75
  if (properties != null) {
84
76
  map = properties.toHashMap()
85
77
  }
86
- Handler(Looper.getMainLooper()).post {
87
- Screeb.assignGroup(type, name, map)
88
- }
78
+ Screeb.assignGroup(type, name, map)
89
79
  }
90
80
 
91
81
  @ReactMethod
@@ -95,9 +85,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
95
85
  if (properties != null) {
96
86
  map = properties.toHashMap()
97
87
  }
98
- Handler(Looper.getMainLooper()).post {
99
- Screeb.unassignGroup(type, name, map)
100
- }
88
+ Screeb.unassignGroup(type, name, map)
101
89
  }
102
90
 
103
91
  @ReactMethod
@@ -107,9 +95,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
107
95
  if (properties != null) {
108
96
  map = properties.toHashMap()
109
97
  }
110
- Handler(Looper.getMainLooper()).post {
111
- Screeb.trackEvent(eventId, map)
112
- }
98
+ Screeb.trackEvent(eventId, map)
113
99
  }
114
100
 
115
101
  @ReactMethod
@@ -119,9 +105,7 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
119
105
  if (properties != null) {
120
106
  map = properties.toHashMap()
121
107
  }
122
- Handler(Looper.getMainLooper()).post {
123
- Screeb.trackScreen(screen, map)
124
- }
108
+ Screeb.trackScreen(screen, map)
125
109
  }
126
110
 
127
111
  @ReactMethod
@@ -148,49 +132,30 @@ class ScreebModuleModule(reactContext: ReactApplicationContext) :
148
132
  }
149
133
  }
150
134
  }
151
- Handler(Looper.getMainLooper()).post {
152
- Screeb.startSurvey(surveyId, allowMultipleResponses ?: true, map, ignoreSurveyStatus ?: true, mapHooks)
153
- }
135
+ Screeb.startSurvey(surveyId, allowMultipleResponses ?: true, map, ignoreSurveyStatus ?: true, mapHooks)
154
136
  }
155
137
 
156
138
  @ReactMethod
157
139
  fun debug(){
158
140
  Log.d("ScreebModule","Called debug")
159
- Handler(Looper.getMainLooper()).post {
160
- Screeb.debug()
161
- }
141
+ Screeb.debug()
162
142
  }
163
143
 
164
144
  @ReactMethod
165
145
  fun debugTargeting(){
166
146
  Log.d("ScreebModule","Called debugTargeting")
167
- Handler(Looper.getMainLooper()).post {
168
- Screeb.debugTargeting()
169
- }
147
+ Screeb.debugTargeting()
170
148
  }
171
149
 
172
150
  @ReactMethod
173
151
  fun resetIdentity(){
174
152
  Log.d("ScreebModule","Called resetIdentity")
175
- Handler(Looper.getMainLooper()).post {
176
- Screeb.resetIdentity()
177
- }
153
+ Screeb.resetIdentity()
178
154
  }
179
155
 
180
156
  @ReactMethod
181
157
  fun closeSdk(){
182
158
  Log.d("ScreebModule","Called closeSdk")
183
- Handler(Looper.getMainLooper()).post {
184
- Screeb.closeSdk()
185
- }
186
- }
187
-
188
- companion object {
189
-
190
- @JvmStatic
191
- fun setAppContext(context: Context){
192
- Screeb.initSdkWithContextOnly(context)
193
- }
194
-
159
+ Screeb.closeSdk()
195
160
  }
196
161
  }
@@ -1,2 +1,3 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTViewManager.h>
3
+ #import <React/RCTEventEmitter.h>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/react-native",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Continuous Product Discovery",
5
5
  "scripts": {
6
6
  "clean": "rm -rf lib/",