Android Notification Not getting Sound And Vibration

前端 未结 4 739
执念已碎
执念已碎 2020-12-11 20:11

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 an

4条回答
  •  一整个雨季
    2020-12-11 20:31

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

    like this

    2. Also make sure that you have added permissions in android manifest for 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"
        }
      }
    

提交回复
热议问题