chore: add post message event for sending cookie to rn widget (#1860)
This commit is contained in:
@@ -59,6 +59,16 @@ export default {
|
|||||||
this.fetchAvailableAgents(websiteToken);
|
this.fetchAvailableAgents(websiteToken);
|
||||||
this.setLocale(getLocale(window.location.search));
|
this.setLocale(getLocale(window.location.search));
|
||||||
}
|
}
|
||||||
|
// Pass cookie to react native widget
|
||||||
|
if (window.ReactNativeWebView) {
|
||||||
|
this.registerListeners();
|
||||||
|
window.ReactNativeWebView.postMessage(
|
||||||
|
JSON.stringify({
|
||||||
|
type: 'auth-token',
|
||||||
|
value: window.authToken,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
this.$store.dispatch('conversationAttributes/get');
|
this.$store.dispatch('conversationAttributes/get');
|
||||||
this.setWidgetColor(window.chatwootWebChannel);
|
this.setWidgetColor(window.chatwootWebChannel);
|
||||||
this.registerUnreadEvents();
|
this.registerUnreadEvents();
|
||||||
|
|||||||
Reference in New Issue
Block a user