Notification is not displaying the correct title, text and icon
See original GitHub issueI am using the code from your example application, but the notification is not showing anything from notificationConfig. The title is testApp is running, message is Tap for more information or to stop the app and there is no icon at all.
Code snippet:
startForegroundService = async () => {
if (Platform.OS !== 'android') {
console.log("Foreground service is available only on Android!");
return;
}
if (Platform.Version >= 26) {
const channelConfig = {
id: 'ForegroundServiceChannel',
name: 'Notification Channel',
description: 'Notification Channel for Foreground Service',
enableVibration: true,
importance: 2
};
try {
await VIForegroundService.createNotificationChannel(channelConfig);
} catch (e) {
console.log('HomePage', e);
}
}
const notificationConfig = {
channelId: 'ForegroundServiceChannel',
id: 3456,
title: 'MyTestApplication',
text: 'Notification test text',
icon: 'ic_notification',
priority: 1
};
if (Platform.Version >= 26) {
notificationConfig.channelId = 'ForegroundServiceChannel';
}
await VIForegroundService.startService(notificationConfig);
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Why Notification does not show the correct smallIcon?
First of all, Large icon and Small icon can be different. setSmallIcon() : sets an icon that should be displayed at status bar...
Read more >RadNotification title icon and text randomly not working - Telerik
The content in the template area always appears correctly but title icon and text sometimes don't work and it appears to be happening...
Read more >Notifications on your Apple Watch - Apple Support
Notifications appear on your Apple Watch or iPhone, but not both. ... the notifying app's name and icon along with the notification title....
Read more >Displaying a Notification - web.dev
Notification with title and body text in Chrome on Linux. ... Expect your action icons not to be displayed at all. The Notification...
Read more >Why does some text display with square boxes in some apps ...
Because the font that the app is trying to use is not present on the system, some other font gets used to display...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Add an icon with name ic_notification in resource of android.
Thanks @ipa127001! To provide a bit more detail, I added my icon as an ic_notification.png file to the following directories which fixed all of the issues mentioned in this ticket:
/android/app/src/main/res/mipmap-hdpi /android/app/src/main/res/mipmap-mdpi /android/app/src/main/res/mipmap-xhdpi /android/app/src/main/res/mipmap-xxhdpi /android/app/src/main/res/mipmap-xxxhdpi