Skip to content Skip to sidebar Skip to footer

Android Notification Not Getting Sound And Vibration

I've used FCM Notifications in My app , I'm Receiving Them and it's showing Title And message Perfectly But,When i'm receiving the Notification Im not getting any sound or vibratio

Solution 1:

1. When you send push notification from firebase make sure that sound option enabled

like this enter image description here

2. Also make sure that you have added permissions in android manifest for vibrate.

<uses-permission android:name="android.permission.VIBRATE" />

3. If you are sending from server than use payload

notification payload of the notification there is a sound key.

From the official documentation its use is:

Indicates a sound to play when the device receives a notification. Supports default or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/.

{
    "to" : ".......",

    "notification" : {
      "body" : "body",
      "title" : "title",
      "icon" : "myicon",
      "sound" : "default"
    }
  }

Solution 2:

IMO you have to add permissions in manifest file like below

<uses-permission android:name="android.permission.VIBRATE" />

Post a Comment for "Android Notification Not Getting Sound And Vibration"