@survicate/react-native-survicate 4.1.0 → 4.1.1
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/README.md +2 -2
- package/android/build.gradle +23 -2
- package/android/src/main/AndroidManifest.xml +2 -1
- package/android/src/main/AndroidManifestNew.xml +3 -0
- package/android/src/main/java/com/survicate/react/SurvicateModuleImpl.java +2 -2
- package/ios/SurvicateBindings.mm +2 -2
- package/ios/SurvicateBindings.xcworkspace/xcuserdata/pawelgodlewski.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ allprojects {
|
|
|
49
49
|
```javascript
|
|
50
50
|
import Survicate, {UserTrait} from '@survicate/react-native-survicate';
|
|
51
51
|
|
|
52
|
-
Survicate.
|
|
52
|
+
Survicate.initializeSdk();
|
|
53
53
|
Survicate.invokeEvent("eventName");
|
|
54
54
|
Survicate.enterScreen("screenName");
|
|
55
55
|
Survicate.leaveScreen("screenName");
|
|
@@ -66,7 +66,7 @@ const listener: SurvicateEventListener = {
|
|
|
66
66
|
onSurveyClosed(event: SurveyClosedEvent) {},
|
|
67
67
|
onSurveyCompleted(event: SurveyCompletedEvent) {},
|
|
68
68
|
}
|
|
69
|
-
Survicate.addSurvicateEventListener(listener);
|
|
69
|
+
const subscription = Survicate.addSurvicateEventListener(listener);
|
|
70
70
|
Survicate.reset();
|
|
71
71
|
```
|
|
72
72
|
|
package/android/build.gradle
CHANGED
|
@@ -46,8 +46,29 @@ if (isNewArchitectureEnabled()) {
|
|
|
46
46
|
apply plugin: 'com.facebook.react'
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
def supportsNamespace() {
|
|
50
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
51
|
+
def major = parsed[0].toInteger()
|
|
52
|
+
def minor = parsed[1].toInteger()
|
|
53
|
+
|
|
54
|
+
// Namespace support was added in 7.3.0
|
|
55
|
+
if (major == 7 && minor >= 3) {
|
|
56
|
+
return true
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return major >= 8
|
|
60
|
+
}
|
|
61
|
+
|
|
49
62
|
android {
|
|
50
|
-
|
|
63
|
+
if (supportsNamespace()) {
|
|
64
|
+
namespace "com.survicate.react"
|
|
65
|
+
|
|
66
|
+
sourceSets {
|
|
67
|
+
main {
|
|
68
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
51
72
|
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
52
73
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
53
74
|
defaultConfig {
|
|
@@ -99,7 +120,7 @@ repositories {
|
|
|
99
120
|
dependencies {
|
|
100
121
|
//noinspection GradleDynamicVersion
|
|
101
122
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
102
|
-
implementation ('com.survicate:survicate-sdk:4.1.
|
|
123
|
+
implementation ('com.survicate:survicate-sdk:4.1.1')
|
|
103
124
|
}
|
|
104
125
|
|
|
105
126
|
if (isNewArchitectureEnabled()) {
|
|
@@ -75,7 +75,7 @@ public class SurvicateModuleImpl extends SurvicateModule {
|
|
|
75
75
|
@ReactMethod
|
|
76
76
|
public void addListener(String eventName) {
|
|
77
77
|
if (listenerCount == 0) {
|
|
78
|
-
Survicate.
|
|
78
|
+
Survicate.addEventListener(eventListener);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
listenerCount++;
|
|
@@ -86,7 +86,7 @@ public class SurvicateModuleImpl extends SurvicateModule {
|
|
|
86
86
|
listenerCount -= count;
|
|
87
87
|
|
|
88
88
|
if (listenerCount == 0) {
|
|
89
|
-
Survicate.
|
|
89
|
+
Survicate.removeEventListener(eventListener);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
package/ios/SurvicateBindings.mm
CHANGED
|
@@ -66,12 +66,12 @@ RCT_EXPORT_METHOD(setWorkspaceKey:(NSString *)workspaceKey)
|
|
|
66
66
|
|
|
67
67
|
- (void)startObserving {
|
|
68
68
|
hasListeners = YES;
|
|
69
|
-
[[SurvicateSdk shared]
|
|
69
|
+
[[SurvicateSdk shared] addListener:self];
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
- (void)stopObserving {
|
|
73
73
|
hasListeners = NO;
|
|
74
|
-
[[SurvicateSdk shared]
|
|
74
|
+
[[SurvicateSdk shared] removeListener:self];
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
- (void)surveyDisplayedWithEvent:(SurveyDisplayedEvent * _Nonnull)event {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@survicate/react-native-survicate",
|
|
3
3
|
"title": "React Native Survicate Bindings",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.1",
|
|
5
5
|
"description": "React Native bindings for Survicate Mobile SDK",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
7
7
|
"module": "lib/module/index.js",
|