Skip to content

Sound not working in Android when App is Killed #250

@arxheji

Description

@arxheji

The custom sound is working when app is in foreground and background but not when app is killed. iOS is working perfectly but I am having trouble debugging why the sound is not coming in Android when App is Killed!

When App is killed I only get the default sound.

I have added the mp3 file under res/raw/alert_signal.mp3 after that I followed the documentation:

android: {
    sound: 'true',
    forceShow: true,
  },

I tried this kind of payload, with both "sound" and "soundname" and each separate as well but still no luck

  data: {
    "sound": "alert_signal",
    "soundname" : "alert_signal",
  }

I also created a channel which has the custom sound:

    PushNotification.createChannel(
      () => {
        console.log('success');
      },
      () => {
        console.log('error');
      },
      {
        sound: 'alert_signal',
        id: 'Test',
        description: 'TestTest',
        importance: 5,
      }
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions