react-native-userleap 2.18.9 → 2.20.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.
@@ -75,6 +75,6 @@ dependencies {
75
75
  if (findProject(':userleap-android-sdk') != null) {
76
76
  implementation project(':userleap-android-sdk')
77
77
  } else {
78
- implementation ("com.userleap:userleap-android-sdk:2.19.5") // update this version on android updates
78
+ implementation ("com.userleap:userleap-android-sdk:2.22.1") // update this version on android updates
79
79
  }
80
80
  }
@@ -199,6 +199,21 @@ public class UserLeapModule extends ReactContextBaseJavaModule {
199
199
  UserLeap.INSTANCE.presentSurvey(null);
200
200
  }
201
201
 
202
+ @ReactMethod
203
+ public void dismissActiveSurvey() {
204
+ UserLeap.INSTANCE.dismissActiveSurvey();
205
+ }
206
+
207
+ @ReactMethod
208
+ public void pauseDisplayingSurveys() {
209
+ UserLeap.INSTANCE.pauseDisplayingSurveys();
210
+ }
211
+
212
+ @ReactMethod
213
+ public void unpauseDisplayingSurveys() {
214
+ UserLeap.INSTANCE.unpauseDisplayingSurveys();
215
+ }
216
+
202
217
  private @Nullable
203
218
  FragmentActivity getFragmentActivity() {
204
219
  Activity activity = getCurrentActivity();
package/index.d.ts CHANGED
@@ -20,6 +20,9 @@ declare namespace UserLeap {
20
20
  function setVisitorAttributesAndIdentify(attributes: {[key: string]: string}, userId: string | undefined, partnerAnonymousId: string | undefined): void;
21
21
  function setUserIdentifier(identifier: string): void;
22
22
  function logout(): void;
23
+ function dismissActiveSurvey(): void;
24
+ function pauseDisplayingSurveys(): void;
25
+ function unpauseDisplayingSurveys(): void;
23
26
  function trackAndPresent(event: string): void;
24
27
  function trackIdentifyAndPresent(event: string, userId: string | undefined, partnerAnonymousId: string | undefined): void;
25
28
  // Uncomment for UI testing
package/index.js CHANGED
@@ -173,6 +173,24 @@ const logout = () => {
173
173
  }
174
174
  };
175
175
 
176
+ const dismissActiveSurvey = () => {
177
+ if (isValidPlatform()) {
178
+ NativeModules.UserLeapBindings.dismissActiveSurvey();
179
+ }
180
+ };
181
+
182
+ const pauseDisplayingSurveys = () => {
183
+ if (isValidPlatform()) {
184
+ NativeModules.UserLeapBindings.pauseDisplayingSurveys();
185
+ }
186
+ };
187
+
188
+ const unpauseDisplayingSurveys = () => {
189
+ if (isValidPlatform()) {
190
+ NativeModules.UserLeapBindings.unpauseDisplayingSurveys();
191
+ }
192
+ };
193
+
176
194
  const trackAndPresent = (event) => {
177
195
  if (isValidPlatform()) {
178
196
  NativeModules.UserLeapBindings.trackAndPresent(event);
@@ -216,6 +234,9 @@ const UserLeap = {
216
234
  logout,
217
235
  trackAndPresent,
218
236
  trackIdentifyAndPresent,
237
+ dismissActiveSurvey,
238
+ pauseDisplayingSurveys,
239
+ unpauseDisplayingSurveys,
219
240
  // Uncomment for UI testing
220
241
  // renderSnapshotForUITest,
221
242
  };
@@ -185,6 +185,21 @@ RCT_EXPORT_METHOD(trackIdentifyAndPresent:(NSString *)eventName userId:(NSString
185
185
  return textProperties;
186
186
  }
187
187
 
188
+ RCT_EXPORT_METHOD(dismissActiveSurvey)
189
+ {
190
+ [[UserLeap shared] dismissActiveSurvey];
191
+ }
192
+
193
+ RCT_EXPORT_METHOD(pauseDisplayingSurveys)
194
+ {
195
+ [[UserLeap shared] pauseDisplayingSurveys];
196
+ }
197
+
198
+ RCT_EXPORT_METHOD(unpauseDisplayingSurveys)
199
+ {
200
+ [[UserLeap shared] unpauseDisplayingSurveys];
201
+ }
202
+
188
203
  - (_SGRNViewProperties * _Nullable)propertiesFromView:(UIView * _Nonnull)passedView {
189
204
  if ([passedView isKindOfClass:[RCTView class]]) {
190
205
  RCTView *rView = (RCTView *) passedView;
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>UserLeapBindings.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-userleap",
3
- "version": "2.18.9",
3
+ "version": "2.20.0",
4
4
  "description": "React Native module for UserLeap",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "jest": "29.7.0",
41
41
  "metro-react-native-babel-preset": "0.67.0",
42
42
  "react": "18.2.0",
43
- "react-native": "0.74.1",
43
+ "react-native": "0.74.7",
44
44
  "react-test-renderer": "18.2.0"
45
45
  }
46
46
  }
@@ -12,12 +12,12 @@ Pod::Spec.new do |s|
12
12
  s.homepage = "https://github.com/github_account/react-native-userleap"
13
13
  s.license = "MIT"
14
14
  s.authors = { "The UserLeap Team" => "ios@userleap.com" }
15
- s.platforms = { :ios => "10.3" }
15
+ s.platforms = { :ios => "15.0" }
16
16
  s.source = { :git => "https://github.com/github_account/react-native-userleap.git", :tag => "#{s.version}" }
17
17
 
18
18
  s.source_files = "ios/**/*.{h,c,m,swift}"
19
19
  s.requires_arc = true
20
20
 
21
21
  s.dependency "React"
22
- s.dependency "UserLeapKit", "4.25.2"
22
+ s.dependency "UserLeapKit", "4.27.3"
23
23
  end