mo-ah-dawood / fcm_config

10 stars 12 forks source link

how to change sound Notification #17

Closed s2yed closed 2 years ago

s2yed commented 2 years ago

how to change sound Notification

mo-ah-dawood commented 2 years ago

You can send it from backend follow this docs https://firebase.google.com/docs/cloud-messaging/http-server-ref

mo-ah-dawood commented 2 years ago

https://fcm.googleapis.com/fcm/send

{
    "notification":{
        "title":"test",
        "body": "Message",
        "sound":"mysound.wav"
    },
    "data":{

    }
}

if you use http the new http of fcm

POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send

{
    "notification": {
      "title": "Breaking News",
      "body": "New news story available."
    },
    "android": {
      "notification": {
        "sound": "mysound.wav"
      }
    },
    "apns": {
      "payload": {
        "aps": {
          "sound" : "mysound.wav"
        }
      }
    },
    "data":{

    }
}
mo-ah-dawood commented 2 years ago

for android you can pass it in AndroidNotificationChannel while init