Reputation: 186
I have a pool of device tokens (iOS and Android) and in the docs, I find only one parameter sound
for both platforms and obviously I have 2 different notification sound, one for Android and one for iOS.
Do I have to split device tokens by device type for sending to 2 separate device types? Or did I just miss something ?
Thanks.
Upvotes: 4
Views: 3325
Reputation: 1648
You could name the same both audio files, like 'your_app.mp3'.
Same name, but different music file on each app. This not allow the user choose the notification sound, but at least allow each app to have a different sound.
Migrate to the new Firebase HTTP v1 API which allows you to customize notifications across platforms
Solution proposed by @daniel-raouf to send Data Messages is great; but in my experience, some Data Messages could not be delivered to your users when:
An user has a power save mode on his phone (by default on Huawei, Xiaomi, One Plus...)
When iOS users clear your app from recent apps (multitask).
So, in my opinion, Data Messages are not a reliable solution for notifications.
Upvotes: 1
Reputation: 2357
You had missed something,
so in the notification body set sound:'default' and it would work for all types of devices
Upvotes: 1