Is chat visible?

isVisible(): Promise

On both iOS and Android, you can use the KustomerChat.isVisible() method to determine if the
Chat UI is visible to the customer.

import KustomerChat from '@kustomer/chat-react-native';

const isVisible = await KustomerChat.isVisible();
console.log(isVisible) // true or false

🚧

On Android, when the Kustomer UI is displayed, a new Android Activity is started causing the JavaScript engine to be backgrounded. This prevents any JavaScript code from being executed while the Kustomer UI is displayed, meaning that calls to KustomerChat.isVisible() will not run while the Kustomer UI is open. A workaround we have found is to use react-native-background-timer or Headless JS to interact with the Kustomer SDK via JavaScript while the Kustomer UI is open.