@originallyus/feedback-rn-sdk 1.0.8 → 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.
Files changed (2) hide show
  1. package/README.md +57 -2
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -56,6 +56,7 @@ Please initalize the SDK once in App.js. The mounting point of the SDK should be
56
56
 
57
57
  Note: **XXXXXXXXXXX** is to be replaced with correct class name. Please refer to the full documentation provided separately by us.
58
58
 
59
+
59
60
  ```js
60
61
  import XXXXXXXXXXX from '@originallyus/feedback-rn-sdk';
61
62
 
@@ -66,9 +67,9 @@ const App = (props) => {
66
67
 
67
68
  // in your render function
68
69
  return (
69
- // Make sure the app is full screen and vertical align center
70
+ {/* The root view wrapper makes sure the app is full screen and vertical align center */}
70
71
  <View style={{ flex: 1, justifyContent: 'center' }}>
71
- <YourOtherContainerView></YourOtherContainerView>
72
+ <YourAppContainerView></YourAppContainerView>
72
73
 
73
74
  {/* Please insert this mount point directly in your App.js,
74
75
  preferably at the bottom of your root view tree for it to stay on top of all other views */}
@@ -76,6 +77,24 @@ return (
76
77
  </View>
77
78
  );
78
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
+ ```
79
98
 
80
99
  All other functions to be invoked on feedbackRef.current can be done anywhere in your application code (can also be inside App.js)
81
100
 
@@ -114,11 +133,24 @@ const OtherComponent = (props) => {
114
133
  feedbackRef.current.testRatingForm(eventTag);
115
134
  };
116
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
+
117
142
  const showRatingForm = (eventTag) => {
118
143
  // This may not always show/trigger the form, depending on the Response Frequency & Prompt Frequency configuration on backend
119
144
  // You may troubleshoot this in "Request" section in CMS
120
145
  feedbackRef.current.showRatingForm(eventTag);
121
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
+
122
154
  };
123
155
  ```
124
156
 
@@ -137,4 +169,27 @@ feedbackRef.current.testRatingForm(eventTag, (formDidShow) => {
137
169
  feedbackRef.current.showRatingForm(eventTag, (formDidShow) => {
138
170
  console.log('formDidShow', formDidShow);
139
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
+
140
195
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@originallyus/feedback-rn-sdk",
3
- "version": "1.0.8",
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
  }