Couldn't Replace Default Bell Notification Icon In Android Using Expo
I'm working on changing the default bell notification using this doc
Environment
"react-native": "^0.74.2",
"expo": "^51.0.11",
"react-native-onesignal": "^5.2.2",
"onesignal-expo-plugin": "^2.0.3",
app.json
{
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development",
"smallIcons": [
"./assets/notification/small_notification_icon_hdpi.png",
"./assets/notification/small_notification_icon_mdpi.png",
"./assets/notification/small_notification_icon_xhdpi.png",
"./assets/notification/small_notification_icon_xxhdpi.png",
"./assets/notification/small_notification_icon_xxxhdpi.png"
],
"largeIcons": [
"./assets/notification/large_notification_icon_hdpi.png",
"./assets/notification/large_notification_icon_mdpi.png",
"./assets/notification/large_notification_icon_xhdpi.png",
"./assets/notification/large_notification_icon_xxhdpi.png",
"./assets/notification/large_notification_icon_xxxhdpi.png"
]
}
]
]
}
Steps to Reproduce Issue
- Create an Expo project following expo docs
- Generate icon from Android Asset studio
- Setup Push notification following OneSignal guide
- Build the app using the command below:
npx expo prebuild
npx expo run:android
- Send a test notification from OneSignal Dashboard
Hello @aodstraitpay thanks for your patience. Are you still having this issue?
If you see the default OneSignal bell icon, it is possible you did not add all icon sizes. Please add all icon sizes and correct paths. Can you confirm that the image is white, transparent, and 256x256 in size?
More info: https://documentation.onesignal.com/docs/notification-icons
- We set mode, devTeam, smallIcons, smallIconAccentColor and iosNSEFilePath,
- We set only one image
96x96for it (documentation says it will be scaled) - We put it in
config/icon/<icon>.png - We named it exactly
ic_stat_onesignal_default.png - The image is exactly 96x96, the icon is only white with full transparent background
And for us Android + iOS are both working.
[
'onesignal-expo-plugin',
{
// ...
smallIcons: ['./config/icon/ic_stat_onesignal_default.png'],
smallIconAccentColor: '#C0FFEE', // Random funny color
// ...
}
]
Our folder structure
android
ios
config
└─ icon
├─ ...
├─ ic_stat_onesignal_default.png
└─ ...
...
app.config.ts
@fadi-george This is highly missleading, considering Expo is the recommended way to develop react-native apps at this moment. Setup documentation for OneSignal + Expo clearly indicates to use Expo plugin. But you stated that it's deprecated, so I expected to have at least an alternative setup for expo + CNG projects
But there are no alternatives to CNG projects right now.
Are we compelled to write our own expo plugins to configure OneSignal? We don't touch native code in our solution (.gitignoring android and ios folder entirely).
@Martinocom-Switcho
The original comment was accidentally deleted.
This repository has been resurrected and we apologize for the inconvenience. Also, this ticket will be worked upon shortly.
Hello, Please go to https://github.com/OneSignal/onesignal-expo-plugin/issues and create the issue there if its related to expo.
Will try to see if I can merge this next week https://github.com/OneSignal/onesignal-expo-plugin/pull/279 .