tlenclos / react-native-audio-streaming

iOS & Android react native module to play an audio stream, with background support and media controls
MIT License
783 stars 254 forks source link

remove notification #134

Open mkdotcom opened 6 years ago

mkdotcom commented 6 years ago

Hello Is there a way to remove the notification? (after I call stop()) Thanks you

graphee-gabriel commented 6 years ago

Same here... The library works pretty well but If I close the app the notification stays and you can't remove it until you re-open the app. You should always close the notification before you close the app. Which is REALLY going to annoy the users... Any fix on the way?

ak99372 commented 6 years ago

You can call

const { ReactNativeAudioStreaming } = NativeModules;

ReactNativeAudioStreaming.destroyNotification();

But this seems to work only when the player is paused/stopped and as @graphee-gabriel mentioned notification doesn't close itself when app exits As far as I can tell there is also no "onAppClose" react-native event that we could use to close it manually