Fire Notification LED

I am using Cordova to create a mobile application and I am trying to send a push notification via google Firebase.

I managed to set the title , body , badge , sound , etc., but I can not figure out how to set the LED blinking when receiving a notification.

I tried using localNotification , but this requires the application to run at any time.

Do you have any ideas on how to fix this?

+6
source share
2 answers

Perhaps a little late, but for other readers:

In NotificationCompat.Builder add this

 .setLights(int argb, int onMs, int offMs) 

Documentation:

Set the argb value that you want the LED on the device to flash, as well as the speed.

Source: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html

0
source

This works for us using node-gcm on the server:

 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); }); 
0
source

All Articles