From e6c02a7398bbe71964826b43f74cfdc512025f84 Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 28 Sep 2017 14:56:20 -0400 Subject: [PATCH] support drawable notif icon --- .../java/com/evollu/react/fcm/SendNotificationTask.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java b/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java index 012bb8f..1068278 100644 --- a/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java +++ b/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java @@ -96,7 +96,12 @@ public class SendNotificationTask extends AsyncTask { //icon String smallIcon = bundle.getString("icon", "ic_launcher"); int smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName); - notification.setSmallIcon(smallIconResId); + if(smallIconResId == 0){ + smallIconResId = res.getIdentifier(smallIcon, "drawable", packageName); + } + if(smallIconResId != 0){ + notification.setSmallIcon(smallIconResId); + } //large icon String largeIcon = bundle.getString("large_icon"); -- 2.26.2