Android Question Firebase notification change sound

tufanv

Expert
Licensed User
Hello,

Is it possible to change the sound of notification of firebase notifications or is it handlel by the user ?

Thanks
 

DonManfred

Expert
Licensed User
i just tried it using Android 9 (compiled with targetsdk 26)

B4X:
    File.Copy(File.DirAssets,"alert.mp3",Starter.Provider.SharedFolder,"alert.mp3")
    Log(Starter.Provider.GetFileUri("alert.mp3"))
    n.CustomSound(Starter.Provider.GetFileUri("alert.mp3"))
I does work only after i initialized it with priority HIGH

B4X:
    Dim n As NB6
    n.Initialize("default", Application.LabelName, "HIGH").AutoCancel(True)
It does work if my app is in foreground.
It does work if my app is in background and just the FirebaseMessaging service get run and show the notification.
 

Erel

Administrator
Staff member
Licensed User
Is it possible to change the sound of notification of firebase notifications or is it handlel by the user ?
There is no such thing: sound notification of firebase notifications.

The firebase push notification causes your app to start and raise the fm_MessageArrived event. You can then do whatever you like.

See NB6 for custom sounds playback.
 
Top