Ionic 2 How to store Push notification in Notification board - ionic-framework

I have an app that can receive several notifications at the same time.
I'm able to receive all of them (by setting style as inbox) but the issue is that when the user click on one notification, the app is opened and ALL the notification disappears... Is there a way that the device can keep the OTHER notifications in the notification list until the user click each of them?
I saw this working in other apps, but I'm trying to do it with Ionic2.
Thanks!

Related

flutter notification chat quick reply

i have an application which is working fine. i add chatting to the app with notification. Any time users are chatting it send notification both in foreground and background.
my question:
how can i add notification reply just like WhatsApp. if a user send me message and i get the notification, i should be able to reply from the notification without opening the app.
Thanks
Have a look at this package: Awesome Notifications. It is still under construction but it will enable you to display custom notifications including a TextField that you can show when a real Push Notification got received.

Automatically open a screen in flutter app on getting a background push notification

I want to know if the following is possible in flutter using flutter firebase messaging (FCM)
Scenario:
The app is closed or killed. A firebase push message is sent to the device (or device is listening on some topic etc.). The app gets the notification in the background and based on a flag in the data, either shows a notification in the notification tray or opens the app and displays a modal dialog to alert the user of an emergency notification. This has to happen automatically without having the user to click on the notification
Use case,
Any notification with medium severity that comes in can be displayed as a notification in the notification tray. The user can click on it and open the app whenever he wants to
Any notification with critical severity and which requires immediate user attention needs to automatically show a modal dialog with some buttons to enable the user to take action. It must play some sound to get the users attention.
I have done this in android previously where we used to get the notification in the notification handler and then based on the incoming message data, we used to either show a notification or show a dialog.

An alert like whatsapp when app is in background in ionic

I am using One Signal push notifications in my ionic app. I want to show an alert when i receive a notification when my app is in background.
I tried using the platform pause and remuse functionality to check for background and foreground and then generate an alert when app was in background using ionic alert controller but was not able to produce the desired result.
I want a pop up dialog box like one in whastapp when u receive a message.
Can anyone please suggest a solution to this.
There is no way to achieve what you're trying to achieve through the use of OneSignal alone. The OneSignal plugin for Ionic has two calls to action:
handleNotificationReceived() & handleNotificationOpened()
The first one is called when the notification is received and the app is in the foreground.
And the second is called when the app is launched from the notification.
You would need some other service to record when notifications are sent to see if there were any when the app was launched by itself. If you use OneSignal's REST API to send notifications yourself, you can record when a notification is sent, and then when the app is launched by itself, you can fetch missed notifications or notification count from your own server. That's just one way you can do it.
But OneSignal is a push notification service, which send notifications. Even if you did FCM yourself and went through the scenario you mentioned, the results would be the same.
It's not a OneSignal issue. It's the way notifications are designed.

Handling Local Notification in objective C

I am working on an iphone app where I store all the local(and push) notifications for my app. There will be a screen on app which shows all the notifications generated by the app. My question is that can an iphone app know when a local notification for that app is shown. for example, suppose that a local notification is shown, but the user simply ignores that notification, and does not tap on it, so in this situation, can my app somehow find out if the local notification was shown and do some processing on it(for example, store the notification data in sqlite database).
I have tried both "didFinishlaunchingWithOptions" and "didReceiveLocalNotificatios", but from my understanding, they are invoked when a user laucnhes app by tapping on the notifiaction, is there a method by which I can have the notification data even when user does not tap on the notification.
tldr; can an iphone app handle(process) local notifications even when user does not launch app by tapping the notification.
No, your app wan't get any notification whcih user has ignored. Your app will notified only when user presses view or tap on that notification.

push notifications: sounds and badges

I'm working with push notifications and i have a doubt: if in my script (server-side) there are badge and sound, but the user set sounds and badges off... what happens?
I mean: i need to register in my database every setting for every token, or i send the notification and the iPhone does all the work? :)
Thanks!
You don't need to worry about the user settings. The user will receive the alerts he allowed. So if he doesn't want to have the sound and he switch it off. You can still send it and he just receive the alert and or badge...
If the user switches off a particular notification type in user settings, such notifications are not received by the application. For example:- lets say I registered for sound and badge notifications but I disabled the badge notifications in user settings, the application will only receive the sound notifications from now until I enable the badge notifications in user settings or register again for alter notifications too. Re-registering for badge notifications wont enable the badge notifications since they are disbled in user settings.