Broadcast registration: addListener broadcasts the name notification_logout followed by the listener callback event
componentDidMount(): void { this.logoutListener = DeviceEventEmitter.addListener('notification_logout',() => { console.log("notification_logout") Actions.replace('login',{type:0}) }); }
Monitor removal:
componentWillUnmount(): void { this.logoutListener.remove() }
Broadcast call:
DeviceEventEmitter.emit('notification_logout', null);