Reputation: 375
I want to play some other sound when hitting any notification in my expo app from node server.I can't find any other sound than 'default'.Is there any other option I can use to play some other sound other than the default one on notifications in expo.My nodeJS code is below:
const receipts = expo.sendPushNotificationsAsync([
{
to: userObj.pushToken,
sound: 'default',
body: notification,
data: { withSome: notification },
priority: 'high',
},
]);
Upvotes: 1
Views: 1041
Reputation: 277
I looked up in the Message Format section of the docs and found this :
A sound to play when the recipient receives this notification. Specify "default" to play the device's default notification sound, or omit this field to play no sound.
Note that on apps that target Android 8.0+ (if using `expo build`, built in June 2018 or later), this setting will have no effect on Android. Instead, use `channelId` and a channel with the desired setting.
sound?: 'default' | null,
Looks like it is not possible to change sound through app.
Upvotes: 1