React-native-push-notification: No sound when get notification

Created on 17 Dec 2019  路  8Comments  路  Source: zo0r/react-native-push-notification

I am not getting any sound when i get any notification from fcm . Even I also not get default sound.
Everything works fine but There is no sound in any notification.

PushNotification.configure({
onRegister: function(token) {
console.log('TOKEN:', token);
}.bind(this),

  onNotification: function(notification) {
    console.log('NOTIFICATION:', notification);
  },
  permissions: {
    alert: true,
    badge: true,
    sound: true,
  },
  senderID: '256504080411',
  requestPermissions: true,
});

Using in constructor of App.js

versions

"react": "16.9.0",
"react-native": "0.61.5",
"react-native-push-notification": "^3.1.9"

Most helpful comment

i have the same issue

Better To use react-native-firebase
It's more mature

All 8 comments

i am sending payload from my server

notification: {
title: 'Title of your push notification',
body: 'Body of your push notification',
playSound: true,
soundName: 'default'
},

Anyone please help me

陌f you're using iOS while app is open, it will not give you sound. in background it will.

No I am using Android.

i have the same issue

i have the same issue

Better To use react-native-firebase
It's more mature

I was having the same problem.
In your notification, try setting "sound":"default". (instead of "playSound"). That seemed to do the trick for me.

I was having a similar issue with sound not working in background notifications. The fix was to pass correct FCM payload.
See here: https://github.com/zo0r/react-native-push-notification/issues/1868#issuecomment-784338446

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanDance picture DanDance  路  3Comments

Benzer1406 picture Benzer1406  路  3Comments

atteia picture atteia  路  4Comments

Kiran0791 picture Kiran0791  路  3Comments

NiuQiaoling picture NiuQiaoling  路  3Comments