Firebase Cloud Messaging Notification Vibration

前端 未结 3 1529
迷失自我
迷失自我 2020-12-29 09:46

Is it possible to make an Android device vibrate when receiving notifications in the background with Firebase Cloud Messaging? From the Syntax Reference I have seen and test

3条回答
  •  失恋的感觉
    2020-12-29 10:03

    You should mark yourself as a correct answer.

    On a sidenote, if you do send a Notification and a Data payload, use

    "notification":{
        "sound":"default"
    }
    

    This will play the sound when the application is in background and the device is set to sound, and it will play a vibration if the device is set to vibrate.

    However, as far as customization goes I think you need to use the Data Payload only if you want to customize the vibration pattern for example.

提交回复
热议问题