config-plugin-react-native-intercom
config-plugin-react-native-intercom copied to clipboard
Do `Intercom.logout()` on boot in the dev-client?
First, this repo is fantastic 🙌 thank you so much!
It allows me to use Intercom together with my expo dev-client. However I have noticed that if I
- Sign into Intercom
- close the dev-client app
- release an intercom carousel
- open the dev-client app manually (no deeplink into my app)
- then the carousel opens up

In my App.tsx I have an Intercom.logout, but that is not called in the dev-client home screen.
I can't seem to find a solution to trigger Intercom.logout when the app is terminated, but perhaps this plugin can build a
Intercom.logout().catch()
into the boot of the dev-client?
I found that I can use the AppState.listener('change', (nextState) => <sign in and out>) for iOS to logout before the user closes the app.
Unlucky this does not work on android. Since closing the app does not cause a AppState "change". Tried listening for the blur but that does not work, since Intercom itself causes the app to blur when showing mobile carousel or conversation.
Is there any way for me to hook into android life-cycle and force a Intercom('shotdown') when the app closes?