Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
764 views
in Technique[技术] by (71.8m points)

android - Firebase Cloud Messaging Notification Vibration

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 tested that sound is supported, but no info on vibration. Or is it somehow possible to provide a customized implementation for this notification where I would directly set the vibration?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...