question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: No custom sound

See original GitHub issue

Hi,

I am having issues with playing a custom sound on android after I upgraded to API 26. The sound worked before this upgrade and currently works in iOS.

I am using RN 0.56.1 and have updated the package to 3.1.2, added a channel name and description in my android manifest as per the readme (this issue occured in 3.1.1 too).

The code below is used to schedule a local notification:

PushNotification.localNotificationSchedule({
    id: id,
    number: 0,
    userInfo: {
        id: id,
        ...payload,
    },
    title: "My title",
    message: "My message",
    date: moment().add(30, 'seconds').toDate(),
    soundName: 'alarm.mp3',
    repeatType: 'minute',
    data: JSON.stringify(payload),
    priority: "max",
    importance: "max",
    visibility: "public",
    autoCancel: false,
});

alarm.mp3 exists in /app/src/main/res/raw/ folder and is 30 seconds long.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:20

github_iconTop GitHub Comments

5reactions
zabojadcommented, May 28, 2019

@zo0r PR https://github.com/zo0r/react-native-push-notification/pull/1042 is very much needed. Could you please do something to make it merged?

5reactions
FredrikMBPcommented, Nov 20, 2018

This fork https://github.com/MaximusBaton/react-native-push-notification has been the only one that works for me. Unfortunately it’s behind a few versions, but it’ll have to do for now until we can get an official fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A reason why custom notification sound might not work on ...
When we use custom sound for a notification channel, we might observe that system shows notifications without sound. Playing custom sound ...
Read more >
Android Custom Notification sound is Not working?
I am getting the custom sound name from the notification and added conditions based on key but always sound only playing in my...
Read more >
How to Change Android Notification Sounds - Lifewire
How to Add Custom Notification Sounds · Go to Settings > Apps & notifications > Notifications. · Scroll down and tap Advanced >...
Read more >
Notification Sounds - OneSignal Documentation
Send Notifications With or Without Sounds. Android & Amazon. Android 8+ introduced Notification Categories which must be setup to customize notification sounds.
Read more >
Customize notification sounds on Android - Atlassian Support
You can customize sounds for each alert action, select an awakening sound for New Alerts and a different sound for Schedule Starts. These...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found