react-native-easy-toast icon indicating copy to clipboard operation
react-native-easy-toast copied to clipboard

Toast message not showing in Android devices

Open akhilsanker opened this issue 6 years ago • 8 comments

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

akhilsanker avatar Mar 01 '19 06:03 akhilsanker

Are you rotating the screen? There is a know issue with screen rotation, see https://github.com/crazycodeboy/react-native-easy-toast/pull/56

sesm avatar Mar 15 '19 09:03 sesm

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

akhilsanker avatar Mar 15 '19 09:03 akhilsanker

Does the toast show up with position: 'top'? If yes, then it may be the same issue anyway.

sesm avatar Mar 15 '19 09:03 sesm

Hi @scue ,

Its position: 'top'. Do you have any workaround to solve this problem?

Thanks

akhilsanker avatar Mar 15 '19 09:03 akhilsanker

No, I never had any problems with this library for position: 'top'

sesm avatar Mar 15 '19 13:03 sesm

zIndex?

maximus123123 avatar Mar 25 '19 08:03 maximus123123

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');

maximus123123 avatar Apr 03 '19 12:04 maximus123123

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

akhilsanker avatar Apr 06 '19 07:04 akhilsanker