Toast message not showing in Android devices
Hi, Using react-native-easy-toast": "^1.1.0, toast position bottom, the toast message is not appearing in Android devices but works fine in iOS devices.
Does anyone have any workaround to solve this issue? Any suggestion is appreciable.
Thanks
Are you rotating the screen? There is a know issue with screen rotation, see https://github.com/crazycodeboy/react-native-easy-toast/pull/56
Hi @sesm , Thanks for your response and is well appreciated. My app has both portrait and landscape mode, but its not working in any orientation.
Thanks
Does the toast show up with position: 'top'? If yes, then it may be the same issue anyway.
Hi @scue ,
Its position: 'top'. Do you have any workaround to solve this problem?
Thanks
No, I never had any problems with this library for position: 'top'
zIndex?
This is working on android with position 'bottom' (none rotated screen through). I made the toast component in my app.js just below my appcontainer from react navigation, then I made a deviceemitter listener, which from other screens I emit the 'toast'
This will allow the toast to show even when changing screen
componentDidMount(){
DeviceEventEmitter.addListener('toast', (e) => {
this.refs.toast.show(e);
});
}
render(){
return(
<View style={{flex: 1}}>
<AppContainer/>
<Toast position='bottom' ref="toast"/>
</View>)
}
.......
on another screen:
DeviceEventEmitter.emit('toast', 'Some Message');
Hi @maximus12312,
I have emitted the event from the screen, in which the toast is shown, but it is not working. Do I need to emit the event from app.js file itself. Or do you have any other workaround. Thanks