我正在使用Cordova制作移动应用程序,并试图通过Google的Firebase发送推送通知。Firebase通知LED闪烁
我可以设置title
,body
,badge
, sound
等,但我不知道如何设置LED闪烁时收到通知。
我试过使用localNotification
,但它需要应用程序始终运行。
你们有没有关于如何解决这个问题的想法?
我正在使用Cordova制作移动应用程序,并试图通过Google的Firebase发送推送通知。Firebase通知LED闪烁
我可以设置title
,body
,badge
, sound
等,但我不知道如何设置LED闪烁时收到通知。
我试过使用localNotification
,但它需要应用程序始终运行。
你们有没有关于如何解决这个问题的想法?
也许有点晚,但对其他读者:
在NotificationCompat.Builder添加此
.setLights(int argb, int onMs, int offMs)
文档:
设置您想对LED的ARGB值该设备眨眼, 以及率。
来源:https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
这工作对我们来说,在服务器上使用node-gcm:
var gcm = require('node-gcm');
var push = new gcm.Message({
data: {
title: 'Your app',
message: message,
ledColor: [215, 138, 138, 1], //show a blinking LED with given color in ARGB format
},
});
gcmSender.send(push, [token], function(err, res) {
console.log(res);
});