@sentiance-react-native/core 6.0.0-beta.13 → 6.0.0-beta.14
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/lib/index.js +8 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -43,8 +43,7 @@ if (Platform.OS === 'ios') {
|
|
|
43
43
|
stopTrip = () => core.stopTripNewApi();
|
|
44
44
|
submitDetections = () => core.submitDetectionsNewApi();
|
|
45
45
|
reset = () => core.resetNewApi();
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
46
|
+
} else {
|
|
48
47
|
startTrip = (metadata, hint) => core.startTrip(metadata, hint);
|
|
49
48
|
stopTrip = () => core.stopTrip();
|
|
50
49
|
submitDetections = () => core.submitDetections();
|
|
@@ -81,7 +80,7 @@ const linkUser = async (linker) => {
|
|
|
81
80
|
* }
|
|
82
81
|
*
|
|
83
82
|
* createUser(userCreationOptions);
|
|
84
|
-
*
|
|
83
|
+
*
|
|
85
84
|
* Or unlinked user with appId / appSecret (Not recommended)
|
|
86
85
|
*
|
|
87
86
|
* const userCreationOptions = {
|
|
@@ -118,7 +117,7 @@ const linkUser = async (linker) => {
|
|
|
118
117
|
* }
|
|
119
118
|
*
|
|
120
119
|
* createUser(userCreationOptions);
|
|
121
|
-
*
|
|
120
|
+
*
|
|
122
121
|
* Or unlinked user with appId / appSecret (Not recommended)
|
|
123
122
|
*
|
|
124
123
|
* const userCreationOptions = {
|
|
@@ -143,23 +142,21 @@ const createUser = async (userCreationOptions) => {
|
|
|
143
142
|
|
|
144
143
|
if (authCode) {
|
|
145
144
|
return core.createLinkedUserWithAuthCode(authCode, platformUrl);
|
|
146
|
-
}
|
|
147
|
-
else if (linker) {
|
|
145
|
+
} else if (linker) {
|
|
148
146
|
if (linker === NO_OP_LINKER) {
|
|
149
147
|
return core.createUnlinkedUser(appId, appSecret, platformUrl);
|
|
150
148
|
} else {
|
|
151
149
|
await core._addUserLinkListener(linker);
|
|
152
150
|
return core.createLinkedUser(appId, appSecret, platformUrl);
|
|
153
151
|
}
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
152
|
+
} else {
|
|
156
153
|
return Promise.reject('Invalid userCreationOptions passed, no authcode or linker specified.');
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
156
|
|
|
160
|
-
const addSdkStatusUpdateListener = core._addSdkStatusUpdateListener;
|
|
161
|
-
const addSdkUserActivityUpdateListener = core._addSdkUserActivityUpdateListener;
|
|
162
|
-
const addTripTimeoutListener = core._addTripTimeoutListener;
|
|
157
|
+
const addSdkStatusUpdateListener = core ? core._addSdkStatusUpdateListener : null;
|
|
158
|
+
const addSdkUserActivityUpdateListener = core ? core._addSdkUserActivityUpdateListener : null;
|
|
159
|
+
const addTripTimeoutListener = core ? core._addTripTimeoutListener : null;
|
|
163
160
|
|
|
164
161
|
const transportModes = {};
|
|
165
162
|
(function (transportModes) {
|