You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arnesson#994 - Updating docs to use Firebase customization
I went through the history and could not find when these files were automatically copied over. I also found Firebase added some customization hooks so updated the documentation on how users can use these hooks to restyle the icons and colors for notifications
By default Firebase will use the app icon as the notification icon. The icon is treated as a silhouette, so if the app icon has a background, it might appear as a large blob. To change the icon, you need to [add the icons](#add-the-icons) to the project and [configure firebase](#configure-firebase).
7
+
8
+
### Add the icons
9
+
Add your icons to your project in your res directory, such as `<projectroot>/res/native/android/res/<drawable-DPI>`. Make sure the icons all have the same name (example has ic_silhouette). Next, we will need to copy the icons over to the Android project when it is created. To do this, add the following lines to your `config.xml`.
Note: the src of the files is not important, but the target directory with the proper dpi filter is very imporant. You will also need to name all the icons the same name.
19
+
20
+
### Configure Firebase
21
+
We need to copy a metadata flag into the Manifest to tell Firebase which icon to use. To do this, add the following line to your `config.xml`.
Note: If you have XML Namespace issues, which I encountered when trying to build in Android Studio, add this `xmlns:android="http://schemas.android.com/apk/res/android"` to the widget element at the root of the `config.xml`.
40
31
41
32
## Notification Colors
42
33
34
+
To add color to the custom icon, you will need to (create a color definition)[#create-a-color-definition] and (configure firebase color)[#configure-firebase-color].
35
+
36
+
### Create a Color Definition
43
37
On Android Lollipop and above you can also set the accent color for the notification by adding a color setting.
We need to copy a metadata flag into the Manifest to tell Firebase which color to use for the icon. To do this, add the following line to your `config.xml`.
Note: If you have XML Namespace issues, which I encountered when trying to build in Android Studio, add this `xmlns:android="http://schemas.android.com/apk/res/android"` to the widget element at the root of the `config.xml`.
68
+
69
+
# Final Result
70
+
71
+
If you added a custom icon and color, your `config.xml` should include something like this.
0 commit comments