@originallyus/feedback-rn-sdk 1.0.7 → 2.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.
- package/README.md +77 -10
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -4,11 +4,16 @@ A cross-platform Feedback component for React Native.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Install the package using either Yarn:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
yarn add @originallyus/feedback-rn-sdk
|
|
11
11
|
```
|
|
12
|
+
or npm:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @originallyus/feedback-rn-sdk
|
|
16
|
+
```
|
|
12
17
|
|
|
13
18
|
## Install Peer Dependencies
|
|
14
19
|
|
|
@@ -21,15 +26,20 @@ react-native-device-info \
|
|
|
21
26
|
react-native-rate
|
|
22
27
|
```
|
|
23
28
|
|
|
29
|
+
or using npm:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install axios crypto-js \
|
|
33
|
+
react-native-encrypted-storage \
|
|
34
|
+
react-native-device-info \
|
|
35
|
+
react-native-rate
|
|
36
|
+
```
|
|
37
|
+
|
|
24
38
|
## Install Custom Fonts
|
|
25
39
|
|
|
26
40
|
Package requires custom fonts found in `fonts` folder:
|
|
27
41
|
|
|
28
42
|
```sh
|
|
29
|
-
AIAEverestBold.ttf
|
|
30
|
-
AIAEverest-Regular.ttf
|
|
31
|
-
AIAEverest-Medium.ttf
|
|
32
|
-
AIAEverest-CondensedMedium.ttf
|
|
33
43
|
OpenSans-Bold.ttf
|
|
34
44
|
OpenSans-Light.ttf
|
|
35
45
|
OpenSans-Regular.ttf
|
|
@@ -44,8 +54,11 @@ Please do not change the filenames as Android are using those to identify fonts.
|
|
|
44
54
|
|
|
45
55
|
Please initalize the SDK once in App.js. The mounting point of the SDK should be placed directly in your App.js for it to stay on top of all other views.
|
|
46
56
|
|
|
57
|
+
Note: **XXXXXXXXXXX** is to be replaced with correct class name. Please refer to the full documentation provided separately by us.
|
|
58
|
+
|
|
59
|
+
|
|
47
60
|
```js
|
|
48
|
-
import
|
|
61
|
+
import XXXXXXXXXXX from '@originallyus/feedback-rn-sdk';
|
|
49
62
|
|
|
50
63
|
const App = (props) => {
|
|
51
64
|
// This initialization should done once inside App.js
|
|
@@ -54,21 +67,39 @@ const App = (props) => {
|
|
|
54
67
|
|
|
55
68
|
// in your render function
|
|
56
69
|
return (
|
|
57
|
-
|
|
70
|
+
{/* The root view wrapper makes sure the app is full screen and vertical align center */}
|
|
58
71
|
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
59
|
-
<
|
|
72
|
+
<YourAppContainerView></YourAppContainerView>
|
|
60
73
|
|
|
61
74
|
{/* Please insert this mount point directly in your App.js,
|
|
62
75
|
preferably at the bottom of your root view tree for it to stay on top of all other views */}
|
|
63
|
-
<
|
|
76
|
+
<XXXXXXXXXXX ref={feedbackRef} />
|
|
64
77
|
</View>
|
|
65
78
|
);
|
|
66
79
|
```
|
|
80
|
+
**Optional inline feedback component**
|
|
81
|
+
|
|
82
|
+
Place `<FeedbackInlineSurvey />` component anywhere in your app view hierarchy where the feedback inline prompt should be shown.
|
|
83
|
+
|
|
84
|
+
- If `<FeedbackInlineSurvey />` component is not present, feedback survey will shown as non-intrusive style
|
|
85
|
+
- The inline component may or may not be shown depends on configuration of the survey in backend
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
import { FeedbackInlineSurvey } from '@originallyus/feedback-rn-sdk';
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
...
|
|
92
|
+
<SomeContainerView>
|
|
93
|
+
<FeedbackInlineSurvey />
|
|
94
|
+
</SomeContainerView>
|
|
95
|
+
...
|
|
96
|
+
);
|
|
97
|
+
```
|
|
67
98
|
|
|
68
99
|
All other functions to be invoked on feedbackRef.current can be done anywhere in your application code (can also be inside App.js)
|
|
69
100
|
|
|
70
101
|
```js
|
|
71
|
-
import
|
|
102
|
+
import XXXXXXXXXXX from '@originallyus/feedback-rn-sdk';
|
|
72
103
|
|
|
73
104
|
const OtherComponent = (props) => {
|
|
74
105
|
// This is a singleton. The initialization should have already been done inside App.js
|
|
@@ -102,11 +133,24 @@ const OtherComponent = (props) => {
|
|
|
102
133
|
feedbackRef.current.testRatingForm(eventTag);
|
|
103
134
|
};
|
|
104
135
|
|
|
136
|
+
const testInlineForm = (eventTag, slug) => {
|
|
137
|
+
// This will always show the inline Feedback component for testing/debugging purpose
|
|
138
|
+
// You may troubleshoot this in "Request (Testing)" section in CMS
|
|
139
|
+
feedbackRef.current.testInlineForm(eventTag, slug);
|
|
140
|
+
};
|
|
141
|
+
|
|
105
142
|
const showRatingForm = (eventTag) => {
|
|
106
143
|
// This may not always show/trigger the form, depending on the Response Frequency & Prompt Frequency configuration on backend
|
|
107
144
|
// You may troubleshoot this in "Request" section in CMS
|
|
108
145
|
feedbackRef.current.showRatingForm(eventTag);
|
|
109
146
|
};
|
|
147
|
+
|
|
148
|
+
const showInlineForm = (eventTag, slug) => {
|
|
149
|
+
// This may not always show/trigger the form, depending on the Response Frequency & Prompt Frequency configuration on backend
|
|
150
|
+
// You may troubleshoot this in "Request" section in CMS
|
|
151
|
+
feedbackRef.current.showInlineForm(eventTag, slug);
|
|
152
|
+
};
|
|
153
|
+
|
|
110
154
|
};
|
|
111
155
|
```
|
|
112
156
|
|
|
@@ -125,4 +169,27 @@ feedbackRef.current.testRatingForm(eventTag, (formDidShow) => {
|
|
|
125
169
|
feedbackRef.current.showRatingForm(eventTag, (formDidShow) => {
|
|
126
170
|
console.log('formDidShow', formDidShow);
|
|
127
171
|
});
|
|
172
|
+
|
|
173
|
+
feedbackRef.current.showInlineForm(eventTag, slug, (formDidShow) => {
|
|
174
|
+
console.log('formDidShow', formDidShow);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Extra configuration
|
|
180
|
+
To ensure that the External Survey works properly, check your AndroidManifest.xml file for the following configuration.
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example">
|
|
184
|
+
<queries>
|
|
185
|
+
<intent>
|
|
186
|
+
<action android:name="android.intent.action.VIEW" />
|
|
187
|
+
<data android:scheme="http" />
|
|
188
|
+
<data android:scheme="https" />
|
|
189
|
+
</intent>
|
|
190
|
+
</queries>
|
|
191
|
+
...
|
|
192
|
+
<!-- Another config -->
|
|
193
|
+
</manifest>
|
|
194
|
+
|
|
128
195
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@originallyus/feedback-rn-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A cross-platform Feedback component for React Native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"react-native": "lib/commonjs/index",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"email": "hello@originallyus.us"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
+
"@babel/runtime": "^7.24.0",
|
|
18
19
|
"babel-preset-react-native": "^4.0.0",
|
|
19
20
|
"react": "^16.2.0",
|
|
20
21
|
"react-native": "^0.53.0"
|
|
@@ -30,5 +31,6 @@
|
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"react-native-android-keyboard-adjust-originallyus": "*"
|
|
33
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
34
36
|
}
|