Local Notification don't play sound or vibrate in background on IOS
See original GitHub issueI am using Firebase push notifications and they are working fine i.e with sound and vibration but when the app is in background mode then the notification is being received without vibration and sound. On Android, only sound is playing in all modes without vibration. My code is:
messaging().onMessage(async remoteMessage => {
PushNotification.localNotification({
vibrate: true,
vibration: 300,
playSound: true,
soundName: 'default',
importance:'high',
invokeApp:true,
allowWhileIdle: true,
priority:'high',
visibility:'public',
/* Android Only Properties */
title:remoteMessage.notification.title, // (optional)
message:remoteMessage.notification.body, // (required)
invokeApp: true,
});
// sendMessage(remoteMessage.notification.body, remoteMessage.notification.title)
// Alert.alert('A new FCM message arrived!', JSON.stringify(remoteMessage));
})
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Local notification sound not playing while app in background
In short, the local notification will not be playing the sound, but instead, the app will play it (while in the background).
Read more >Running Background Tasks | Apple Developer Forums
I simply want to notify the user by playing a sound or vibrating or both. The only way to trigger this sort of...
Read more >Get Sound Notifications on your phone - Google Help
How to use Sound Notifications. Sound Notifications never send audio or background conversations to Google without your consent. All audio is processed locally...
Read more >Behaviour - Notifee
By default, notifications will use the device's default notification sound, or whatever the user has chosen as the device default. If required, you...
Read more >can we stop vibrate and play sound when push notification ...
Long answer: when the phone is set on vibrate, it is not possible to set it so that it will play a sound....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You define it
@faizanbuggy I resolved this by adding a
sound="default"
param in my service that sends the push notifications in the backend. Maybe you can try this.