Android Question Firebase notification change sound

tufanv

Expert
Licensed User
Longtime 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
Longtime 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.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime 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.
 
Upvote 0
Top