webtonative 1.0.78-beta.4 → 1.0.78-beta.5
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/OrufyConnect/index.d.ts +4 -4
- package/OrufyConnect/index.js +15 -15
- package/package.json +1 -1
package/OrufyConnect/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type ICb = {
|
|
2
|
-
callback
|
|
2
|
+
callback?: (response: {
|
|
3
3
|
type: string;
|
|
4
4
|
} & Record<string, any>) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const onUnreadChatCountsChange: (options?: ICb) => void;
|
|
7
|
-
export declare const openConnectWidget: (
|
|
7
|
+
export declare const openConnectWidget: (data?: ICb & {
|
|
8
8
|
chatId?: string;
|
|
9
9
|
}) => void;
|
|
10
10
|
export declare const widgetLogin: (data?: Record<string, any>) => void;
|
|
@@ -19,7 +19,7 @@ export declare const setExternalUserid: (options: ICb & {
|
|
|
19
19
|
}) => void;
|
|
20
20
|
export declare const isUserLoggedIn: (options: ICb) => void;
|
|
21
21
|
export declare const getUser: (options: ICb) => void;
|
|
22
|
-
export declare const setWidgetConfig: (
|
|
22
|
+
export declare const setWidgetConfig: (data: Record<string, any>) => void;
|
|
23
23
|
export declare const getUnreadChatsCount: (options: ICb) => void;
|
|
24
|
-
export declare const sendChatMessage: (
|
|
24
|
+
export declare const sendChatMessage: (data: ICb) => void;
|
|
25
25
|
export {};
|
package/OrufyConnect/index.js
CHANGED
|
@@ -21,8 +21,8 @@ var onUnreadChatCountsChange = function (options) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
exports.onUnreadChatCountsChange = onUnreadChatCountsChange;
|
|
24
|
-
var openConnectWidget = function (
|
|
25
|
-
var callback = (
|
|
24
|
+
var openConnectWidget = function (data) {
|
|
25
|
+
var callback = (data || {}).callback;
|
|
26
26
|
(0, utills_1.registerCb)(function (response) {
|
|
27
27
|
var type = response.type;
|
|
28
28
|
if (type === "openConnectWidget") {
|
|
@@ -30,19 +30,19 @@ var openConnectWidget = function (options) {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
if (index_1.isAndroidApp) {
|
|
33
|
-
utills_1.webToNative.openConnectWidget(JSON.stringify(
|
|
33
|
+
utills_1.webToNative.openConnectWidget(JSON.stringify({ data: data }));
|
|
34
34
|
}
|
|
35
35
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
36
36
|
utills_1.webToNativeIos.postMessage({
|
|
37
37
|
action: "openConnectWidget",
|
|
38
|
-
data:
|
|
38
|
+
data: data,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
exports.openConnectWidget = openConnectWidget;
|
|
43
43
|
var widgetLogin = function (data) {
|
|
44
44
|
if (index_1.isAndroidApp) {
|
|
45
|
-
utills_1.webToNative.widgetLogin(JSON.stringify(data));
|
|
45
|
+
utills_1.webToNative.widgetLogin(JSON.stringify({ data: data }));
|
|
46
46
|
}
|
|
47
47
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
48
48
|
utills_1.webToNativeIos.postMessage({
|
|
@@ -54,7 +54,7 @@ var widgetLogin = function (data) {
|
|
|
54
54
|
exports.widgetLogin = widgetLogin;
|
|
55
55
|
var setUserDetails = function (data) {
|
|
56
56
|
if (index_1.isAndroidApp) {
|
|
57
|
-
utills_1.webToNative.setUserDetails(JSON.stringify(data));
|
|
57
|
+
utills_1.webToNative.setUserDetails(JSON.stringify({ data: data }));
|
|
58
58
|
}
|
|
59
59
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
60
60
|
utills_1.webToNativeIos.postMessage({
|
|
@@ -102,7 +102,7 @@ var setAppId = function (options) {
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
if (index_1.isAndroidApp) {
|
|
105
|
-
utills_1.webToNative.setAppId(JSON.stringify(appId));
|
|
105
|
+
utills_1.webToNative.setAppId(JSON.stringify({ data: appId }));
|
|
106
106
|
}
|
|
107
107
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
108
108
|
utills_1.webToNativeIos.postMessage({
|
|
@@ -121,7 +121,7 @@ var setExternalUserid = function (options) {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
if (index_1.isAndroidApp) {
|
|
124
|
-
utills_1.webToNative.setExternalUserid(JSON.stringify(externalUserId));
|
|
124
|
+
utills_1.webToNative.setExternalUserid(JSON.stringify({ data: externalUserId }));
|
|
125
125
|
}
|
|
126
126
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
127
127
|
utills_1.webToNativeIos.postMessage({
|
|
@@ -167,14 +167,14 @@ var getUser = function (options) {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
exports.getUser = getUser;
|
|
170
|
-
var setWidgetConfig = function (
|
|
170
|
+
var setWidgetConfig = function (data) {
|
|
171
171
|
if (index_1.isAndroidApp) {
|
|
172
|
-
utills_1.webToNative.setWidgetConfig(JSON.stringify(
|
|
172
|
+
utills_1.webToNative.setWidgetConfig(JSON.stringify({ data: data }));
|
|
173
173
|
}
|
|
174
174
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
175
175
|
utills_1.webToNativeIos.postMessage({
|
|
176
176
|
action: "setWidgetConfig",
|
|
177
|
-
data:
|
|
177
|
+
data: data,
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
};
|
|
@@ -197,8 +197,8 @@ var getUnreadChatsCount = function (options) {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
exports.getUnreadChatsCount = getUnreadChatsCount;
|
|
200
|
-
var sendChatMessage = function (
|
|
201
|
-
var callback = (
|
|
200
|
+
var sendChatMessage = function (data) {
|
|
201
|
+
var callback = (data || {}).callback;
|
|
202
202
|
(0, utills_1.registerCb)(function (response) {
|
|
203
203
|
var type = response.type;
|
|
204
204
|
if (type === "sendChatMessage") {
|
|
@@ -206,12 +206,12 @@ var sendChatMessage = function (options) {
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
if (index_1.isAndroidApp) {
|
|
209
|
-
utills_1.webToNative.sendChatMessage(JSON.stringify(
|
|
209
|
+
utills_1.webToNative.sendChatMessage(JSON.stringify({ data: data }));
|
|
210
210
|
}
|
|
211
211
|
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
212
212
|
utills_1.webToNativeIos.postMessage({
|
|
213
213
|
action: "sendChatMessage",
|
|
214
|
-
data:
|
|
214
|
+
data: data,
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
217
|
};
|