Open woniesong92 opened 7 years ago
Q1: I've asked Firebase and the team decides to show the banner silently only. Q2. You should see a banner. let me try to reproduce
Might be related. I wasn't seeing local notifications either. Turns out it was because ic_notification
icon wasn't found in android resources and the notification centre refused to show the notification without an icon.
Maybe these lines should default to ic_launcer
if the resource is not found and log a warning? Currently it trusts the library user to provide a usable icon name.
The readme should be changed to ic_launcher for the small icon in notification.
Will update
@woniesong92 does this solve your issue?
Hi @evollu. Is it not possible to show the banner when the app is in background at all? I know you answered this: Q1: I've asked Firebase and the team decides to show the banner silently only. But is there a way to get around this, so it is showing the banner when app is in background?
@rasmusviben check the latest repo. It provides a way to show the banner now
Still doesn't work for me here. Local notification not showing when app is on foreground.
Hi, i have still the same issue on Android it doesn't show the notification banner when app is in background and it shows nothing if the app is in foreground (except sound and vibration, but no banner and no notification in the notification center).
Using: RN: 41.2 RN-FCM: 6.1.0 Android: 7.1 Firebase: 10.0.1
This is my code to create a local notification, i think there is nothing special here:
FCM.presentLocalNotification({
title: 'My title',
body: 'My Body',
big_text: 'My big Text',
priority: "high",
show_in_foreground: true,
local: true,
icon: "ic_launcher",
large_icon: "ic_launcher",
});
I'have tried local notifications and remote notifications with the custom_notification feature. Also tried with different values, but it's always the same result. To setup notifications on android i followed the README and checked it several times, have i missed something, maybe? Do you have any advice or solution for this?
have you tried the example project?
For now i've only used code from the example project and it doesn't work in my project. But when building the example project it works as expected.
I don't know why, maybe i have forgot something or doesn't use it correctly. The Javascript code is pretty clear and easy, currently i think it has something todo with the android manifest or build... i will try it again.
have you verified permission setup in AndroidManifiest.html?
Ok, i'm sorry i found the solution!
We are not native guys, so we followed a random internet guide to setup the android app. And we don't have an "ic_launcher" icon. We use some other custom named icons... So when i change the icon to our correct icon name it works like a charm! Finally... :)
Thanks for your patience and your great work with this package!
cool
@evollu @dino115 I try to change icon to the right path, but no luck. No banner show on when i push message from firebase. Any suggest? Many thanks.
same problem but cause from my phone notification setting
I'm using RN 35.0 and Android 6.0. Below is my code.
1. App is killed, Device is locked Notification appears in a banner
2. App is killed, Device is unlocked Notification appears in the system tray
3. App is in background Notification appears in the system tray
4. App is in foreground Notification comes in but calling
FCM.presentLocalNotification({})
doesn't show any UI (I expected to see a banner or modal coming from bottom or top)Q1. How come notification only appears in system tray silently?
Q2. How do I show a banner while the user is using the app (foreground)? I thought calling
FCM.presentLocalNotification({})
will show a UI (either modal or banner) inside an app to notify the user. I saw your answers in F&Q:When you say you can create a local notification yourself. what do you mean?