We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to play the notification sound simultaneously on android phone and bluetooth device
my code is below
messaging().setBackgroundMessageHandler(async (remoteMessage) => { const { android } = remoteMessage; const { body, title, android_channel_id } = remoteMessage?.data; const notificationOptions = { message: body, title, vibrate: true, importance: Importance.HIGH, vibrationPattern: [400, 400], playSound: true, }; let channels = { newservice: 'notnew.mp3', }; if (android?.channelId === "cnclservice" || android_channel_id === "cnclservice") { channels = { cnclservice: 'notcncl.mp3' }
} else if (android?.channelId === "notify" || android_channel_id === "notify") { channels = { notify: 'notalert.mp3', } } Object.entries(channels).forEach(([channelId, soundName]) => { const options = { ...notificationOptions, soundName, channelId, }; PushNotification.localNotification(options); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to play the notification sound simultaneously on android phone and bluetooth device
my code is below
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
const { android } = remoteMessage;
const { body, title, android_channel_id } = remoteMessage?.data;
const notificationOptions = {
message: body,
title,
vibrate: true,
importance: Importance.HIGH,
vibrationPattern: [400, 400],
playSound: true,
};
let channels = {
newservice: 'notnew.mp3',
};
if (android?.channelId === "cnclservice" || android_channel_id === "cnclservice") {
channels = {
cnclservice: 'notcncl.mp3'
}
} else if (android?.channelId === "notify" || android_channel_id === "notify") {
channels = {
notify: 'notalert.mp3',
}
}
Object.entries(channels).forEach(([channelId, soundName]) => {
const options = {
...notificationOptions,
soundName,
channelId,
};
PushNotification.localNotification(options);
});
});
The text was updated successfully, but these errors were encountered: