Flutter Local Notification package in different isolate - android

My goal is display a notification by backgound data message, If user click notification then direct to certain screen, But like this issue says currently onDidReceiveNotificationResponse won't fired if FlutterLocalNotificationsPlugin initialized in different isolate more then once, Is there anyway to solve this? Or there have other plugin can solve this issue?

Related

Is there a way to control app icon shortcut badge count in a react-native android application?

Actually the thing I want to achieve is, normally the shortcut icon badge count in android got cleared once the push notification popup is acknowledged by an user from notification panel, but instead clearing the count as above it has to be cleared only after the corresponding notification is acknowledged by an user within the app(for eg: if an user received a text message then the badge count will increased to one and once the user cleared the push notification popup form notification panel then the badge will also got cleared, but instead of that badge should be cleared only after the user viewed the message).
I tried the following packages.
https://www.npmjs.com/package/react-native-app-badge
https://www.npmjs.com/package/react-native-android-badge
Looks like you can use ShortcutBadge.setCount(0); to clear the badge counter!
I dont know what you use to display a notification on the android device itself, probably react-native-push-notification.
If that's the case, they also have a function for it:
PushNotification.setApplicationIconBadgeNumber(0)
You just need to run one of these functions when the event of a dismissed notification triggers, which may or may not need some java coding for achieve it!

Flutter Android Notification not being Shown

I'm developing an app in Flutter and using Firebase to send Push Notifications, the phone is receiving them but the issue is that I wan't to display a little retancle with some text inside such as WhatsApp does when you receive a new message, but mines just go for the top of the notifications bar and doesn't show anything. Does anyone know how to proceed or how is called the component that I need to implement?
Expected result:
Thank you!!

OneSignal - Popup Notifications not showing in Android React Native

I am unable to view Popup Notification on android app created via react-native using OneSignal. I am able to view it in System tray. The eventListener onReceived function of OneSignal is also called and I can see the notification (only in the system tray) and also able to hear the ding sound, but notification popup did not show.
My code where I configure OneSignal in the main container:
OneSignal.init("ONE_SIGNAL_APP_ID");
OneSignal.inFocusDisplaying(2);
OneSignal.addEventListener('ids', (payload) => store.dispatch(Actions.savePushTokenLocal(payload)));
OneSignal.addEventListener('received', (payload) => store.dispatch(Actions.notificationReceived(payload)));
OneSignal.addEventListener('opened', (payload) => store.dispatch(Actions.notificationOpened(payload)));
OneSignal.configure()
I need to be able to view the notification popup when the notification is received, but I am unable to. I have tried almost everything that the documentation has to offer, but all in vain.
Please help me in this.
Unfortunately at the time of writing this it seems like it there have been issues on this. On the iOS initialization docs (https://documentation.onesignal.com/docs/react-native-sdk) it states "At the present time, none of these settings are available in the Android SDK." which below refers to setting the kOSSettingsKeyInFocusDisplayOption parameter. I assuming this is causing your problem and hopefully available in the future. The best solution may be to set the inFocusDisplaying to 0 and present a custom notification by animating a component into view for a set time when a notification is received. That way you have the ability to customize how the notification displays and behaves.

Android Notifications disappear after some time

Android notifications disappear after some time, without touching it to cancel. What could cause this kind of problem? The notification is started in a Service.
Is that possible that the low memory causes this kind of problem?
Make sure that there is no any other service or project module, which does the following call NotificationManager.cancelAll() to cancel all the notifications. It is always better to keep the notifications controller over Unique ID and cancel only the notifications which are related to that part, by this the code won't touch the notifications posted by other project parts.
NotificationManager documentation.

In Android how do I get the currently displayed notification for a given notification id?

My intention is to display a notification with a personalised icon. However, if a notification with the same id is already displayed and then I need to add a new notification with the same id, my program will instead prepare a "stacked" version of the notification where the icon is changed to some generic icon and the notification content shows excerpts from the last and current notifications. Similar to how Gmail does when there are multiple emails.
To implement that I need to check if there are notifications of my app, currently displayed. I do not see any API to retrieve my own notifications.
I cannot simply cache the notification details that I have displayed till now, since in that case I need to know when they will be dismissed by the user, and update my cache accordingly. I also do not see any API to listen for dismiss events.
If you observe the gmail app notification behaviour properly u will notice that even when u dismiss one notification gmail shows you the same notification again in the list when a new notification comes. It looks to me that gmail is relying on total unread/unopened messages rather than keeping a cache of notifications.
There is no direct api for ur suggested SDK version. You need to fallback to ur own implementation. However, there is a way to know if a already showed notification was dismissed - How to know when my notification is cleared via Clear button?
This is possible with android 4.3 upwards now
See http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications()

Categories

Resources