How can I set notification sound when app is not running in React-Native firebase

I'm trying to make notification ringing when app is not running in IOS.

Here is my code.

  this.notificationListener = firebase.notifications().onNotification((notification: Notification) => {

    // SET SYSTEM DEFAULT SOUND!
    notification.setSound("default");
    firebase.notifications().displayNotification(notification);

  });

When app is in background or foreground ( Maybe I can say 'app is running'), notification rings well.

Should I need to use other listener? Or should I need to add my own sound file for ringing?



Read more here: https://stackoverflow.com/questions/54641738/how-can-i-set-notification-sound-when-app-is-not-running-in-react-native-firebas

Content Attribution

This content was originally published by newbeeep at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: