File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,27 @@ Use Firebase console to send FCM messages to device or emulator.
48
48
message printed in the logs. If it is in the background, a system notification should be
49
49
displayed. When the notification is tapped, the application should return to the quickstart application.
50
50
51
+ Best Practices
52
+ --------------
53
+
54
+ ## Customize default notification
55
+
56
+ ### Custom default icon
57
+
58
+ Setting a custom default icon allows you to specify what icon is used for notification
59
+ messages if no icon is set in the notification payload. Also use the custom default
60
+ icon to set the icon used by notification messages sent from the Firebase console.
61
+ If no custom default icon is set and no icon is set in the notification payload,
62
+ the application icon (rendered in white) is used.
63
+
64
+ ### Custom default Color
65
+
66
+ You can also define what color is used with your notification. Different android
67
+ versions use this settings in different ways: Android < N use this as background color
68
+ for the icon. Android >= N use this to color the icon and the app name.
69
+
70
+ See the [ docs] ( https://goo.gl/sPggnS ) for more.
71
+
51
72
Result
52
73
-----------
53
74
<img src =" app/src/screen.png " height =" 534 " width =" 300 " />
Original file line number Diff line number Diff line change 8
8
android : label =" @string/app_name"
9
9
android : theme =" @style/AppTheme" >
10
10
<!-- [START fcm_default_icon] -->
11
+ <!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
12
+ See README(https://goo.gl/l4GJaQ) for more. -->
11
13
<meta-data
12
14
android : name =" com.google.firebase.messaging.default_notification_icon"
13
15
android : resource =" @drawable/ic_stat_ic_notification" />
16
+ <!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
17
+ notification message. See README(https://goo.gl/6BKBk7) for more. -->
14
18
<meta-data
15
19
android : name =" com.google.firebase.messaging.default_notification_color"
16
20
android : resource =" @color/colorAccent" />
You can’t perform that action at this time.
0 commit comments