I have an app in Expo and as an apk. Sound in notifications is working after I set up with android notification channels. However, the only way to make the sound work is to go into the android device and select a specific sound for the channel. I don’t want our users to have to do this.
Here is what I have in my App.js
componentDidMount() {
// ...
if (Platform.OS === 'android') {
Expo.Notifications.createChannelAndroidAsync('statusReports', {
name: 'StatusReports',
sound: true,
priority: 'max',
vibrate: [0, 250, 250, 250],
});
}
}
I have tried the following in my server code with “StatusReports” and “Default” as the channelId
both kinda do the same thing. I can see in my device’s notifications settings that the channel “StatusReports” is created. The sound for this channel by default is “silent”. I am testing with a Galaxy S8
and from my server
message = {
to: device.reg_key,
sound: 'default',
title: expoOutMessage.title,
body: expoOutMessage.message,
android: {
channelId: "StatusReports"
},
subtitle: "PivoTrac Report",
};
messages.push(message);
another odity i found is if I do set the sounds “Default” and “StatusReports” the Default one is the one that sounds, not the one in the channel I named. Not that this is such a bad thing, as long as there is a sound, but would rather not have our clients have to set this up. iOS devices work fine.