FCM flutter enable notification vibration
717
You can set the sound
property to default
so it makes uses the default sound if sound is enabled and it vibrates if the device is on vibrate.
You can update your payload to this:
const payload = {
notification: {
title: "title",
sound: "default"
},
android: {
priority: "high",
ttl: 60 * 60 * 1,
notification: {
channel_id: 'YO',
},
},
apns: {
payload: {
aps: {
sound: "default"
}
},
headers: {
"apns-collapse-id": "yo",
"apns-priority": "10"
}
},
priority: 10
}
Author by
genericUser
🔠looking for knowledge to grab 🤓 🎯 Learn, Contribute and Grow 🌱
Updated on December 31, 2022Comments
-
genericUser 10 months
I'm developing a Flutter application for Android and IOS. I have created notification channels for Android according to this article.
My node.js payload:
const payload = { notification: { title: "title", }, android: { priority: "high", ttl: 60 * 60 * 1, notification: { channel_id: 'YO', }, }, apns: { payload: { aps: { sound: "sound_03.caf" } }, headers: { "apns-collapse-id": "yo", "apns-priority": "10" } }, priority: 10 }
My notifications are working just fine, for both Android and IOS. The problem is that vibration is disabled by default.
How to enable notification vibration for Android and IOS?
-
genericUser about 2 yearsThanks @Victor Eronmosele. I have just checked some apps, that are using the default sound, on my phone, and some are in vibrate and some not. How do I ensure that the "default" sound vibes?