From 709b60df5afc5cbd2337e870e7f4d4c98813d2be Mon Sep 17 00:00:00 2001 From: Simon Lemieux Date: Mon, 3 Oct 2016 15:58:16 -0400 Subject: [PATCH] Add basic LED blinking support for local notifications on Android (#138) --- README.md | 1 + .../java/com/evollu/react/fcm/FIRLocalMessagingHelper.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 37133ed..c672a16 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,7 @@ class App extends Component { tag: 'some_tag', // Android only group: "group", // Android only my_custom_data:'my_custom_field_value', // extra data you want to throw + lights: true, // Android only, LED blinking (default false) }); FCM.scheduleLocalNotification({ diff --git a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java index befe106..b818b13 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -150,6 +150,11 @@ public class FIRLocalMessagingHelper { } } + //lights + if (bundle.getBoolean("lights")) { + notification.setDefaults(NotificationCompat.DEFAULT_LIGHTS); + } + if(mIsForeground){ Log.d(TAG, "App is in foreground, broadcast intent instead"); Intent i = new Intent("com.evollu.react.fcm.ReceiveLocalNotification"); -- 2.26.2