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
Firebase Push Notification play first a sound at raw for phones above SDK 26.
remoteMessage.notification
{ "sound":"car_park_full", "android_channel_id":"default_channel_id", "data":{"carParkStatus":"true"} }
playing a sound for android 8 and above
soundUri = if (aioNotification.carparkStatus) { Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_empty_tr); } else { Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_full_tr); } } val attributes = AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION) .build() if (soundUri != null) { chan.setSound( soundUri, attributes ) }
playing a sound for android 8 and below
var soundUri: Uri? = null if (aioNotification.carparkStatus != null) { soundUri = if (aioNotification.carparkStatus) { Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_empty_tr); } else { Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_full_tr); } } if (soundUri != null) { notificationCompatBuilder.setSound(soundUri) }
but notification just play first sound in the raw folder.
example -->
play => car_park_full
play => car_park_empty
Assuming that notification comes this way and that the raw folder is that way.
The sound that plays is abcde.m4a. So It's sound where first index in the raw folder.
Notification was sent from server. Sound value was sent as 'car_park_full.m4a' from server but Sound value came as 'car_park_full' to client.
Notification was sent from server.
Sound value was sent as 'car_park_full.m4a' from server but Sound value came as 'car_park_full' to client.
Does anyone know what the reason is?
The text was updated successfully, but these errors were encountered:
This issue does not seem to follow the issue template. Make sure you provide all the required information.
Sorry, something went wrong.
No branches or pull requests
Firebase Push Notification play first a sound at raw for phones above SDK 26.
remoteMessage.notification
playing a sound for android 8 and above
playing a sound for android 8 and below
but notification just play first sound in the raw folder.
example -->
play => car_park_full
play => car_park_empty
remoteMessage.notification
Assuming that notification comes this way and that the raw folder is that way.
The sound that plays is abcde.m4a. So It's sound where first index in the raw folder.
Does anyone know what the reason is?
The text was updated successfully, but these errors were encountered: