chore: enable close button in react-native widget (#1910)

This commit is contained in:
Muhsin Keloth 2021-03-15 10:10:26 -07:00 committed by GitHub
parent b6f4006c15
commit 7d5493ac78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 12 deletions

View file

@ -26,3 +26,11 @@ export const IFrameHelper = {
},
getMessage: e => JSON.parse(e.data.replace(WOOT_PREFIX, '')),
};
export const RNHelper = {
isRNWebView: () => window.ReactNativeWebView,
sendMessage: msg => {
window.ReactNativeWebView.postMessage(
`chatwoot-widget:${JSON.stringify({ ...msg })}`
);
},
};