TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
220 stars 50 forks source link

Custom Notification Sounds Don't Play on Android #28

Open CHIPSNetwork opened 2 years ago

CHIPSNetwork commented 2 years ago

Notifications always play the default sound, rather than the specified on embedded as a resource in the Android Xamarin app

Steps to reproduce: 1 - In Visual Studio: copy .wav file to ProjectName.Android/Resources/raw

2 - Confirm Build Action = AndroidResource

3 - Send notification using FirebaseAdmin with code similar to following:

Works fine in IOS, always plays default sound on Android.

Dim aps = New Aps With {.Sound = "personalnotification.wav"} Dim android_options = New AndroidNotification With {.Sound = "personalnotification.wav"} Dim message = New Message() With { .Apns = New ApnsConfig With {.Aps = aps}, .Android = New AndroidConfig With {.Notification = android_options}, .Notification = New Notification With { .Title = Title, .Body = Body }, .Token = Token } Dim Messaging = FirebaseMessaging.DefaultInstance Call Messaging.SendAsync(message)

K1LL3R234 commented 11 months ago

Where do you load the .wav file for ios and android?