I am building a delivery app (similar to uber eats) with flutter. I want the restaurant owner to get notified whenever a new order arrives.
Basically what I need is either a non-stopping sound to be played e.g. along with the notification in the notification tray, or even better popup that displays some message. That needs to be achieved even when the phone is inactive, and even when the app is not running in the background.
However with the FCM Plugin it seems impossible to achieve this "waking up" of the app. Can anyone suggest any workaround?
Related
I have a working PWA application and i have tried integrating push notifications to it which worked. But those notifications happened totally in the front end, a user has to click a button and a push notifications would show up.
In my application i have a cronjob that runs every night to check if certain things are updated. If so i want to send a push notification to a user to notify them.
But i cannot find any information regarding this subject so I'm thinking it's not possible since the nodejs server doesn't have a connection to the PWA. Is there something I'm overlooking on my approach or is it simply not possible?
I have a chat app like WhatsApp in Unity. I want to send user notification when he received any Chat.
What I've tried yet...
I have OnChildAdded Listener but it only works when Scene is Running on Foreground.
Simple Notifications in Unity which only shows notifications after some time delay.
How can I Keep the Firebase OnChildAdded Services running in the background and show a notification to the user when any child is added to the Chats Node? (firebase - realtime)
Unfortunately, Realtime Database will not continue to work in the background (in fact, once your Activity/game is not visible, Android and iOS may kill it to save battery life or free up memory for another app).
If you'd like to send a message to a user when your app is not running, Firebase Cloud Messaging would be the way to go.
There is a rough tutorial that may help here - although it references the Android SDK rather than the Unity one.
I hope that helps!
--Patrick
There are no problems with the code, because if I press on the notification it triggers onResume, however if the app it's killed or the user deletes the notification no callbacks are triggered.
Right now I'm saving notifications locally on an SQL db, so when a user logs in back it shows how many notifications he hasn't read. However, If I can't trigger no callback when he deletes the notification or when the app is killed (Actually when the user logs in back, after a couple of seconds onMessage is called with the notification sent while the app was killed, however this still bothers me 'cause I can't get user's attention with notifications) I can't save them locally and when he logs in back in the app, those notifications that he dismissed won't ever be back.
Is there a way to callback a function when the user dismisses notifications or when my app is killed?
Basically as you know, notifications are designed to be removed by users.
So if you want users to see all the notifications from your service, you should consider with another UX something like notifications tab (Facebook, Instagram has)
And, manage all notifications from the server, set flag if it is been activated or not.
As far as I know, there is no callback when the user dismissed the one.
I hope it can help you to decide your service design.
I have a Worklight app doing push notifications. Sending the push causes the notification to appear in the notification bar on both Android and iOS as expected. If the push is received while the app is running, it calls the message handler function as it is supposed to.
The issue I'm having is that if you launch the app by tapping on the notification on iOS, the message handler never gets called if another push is sent while the app is running. I have to exit the app and kill it completely, then relaunch the app from the launcher. Then if the push is received while the app is running, it will call the message handler.
This only occurs on iOS. The app will respond to a received message on Android while the app is running, even if the app has been launched by tapping on the notification.
EDIT:
I did struggle to verbalize the scenario, couldn't find the right words that made sense, but the steps you have done Idan are largely correct for what I'm trying to do. We are doing tag based notifications, so that is different that what you have done. We are also using PersistentCookieAuthentication as they wanted push notifications to be sent without the user having to explicitly logging in.
We are currently using WL build 6.2.0.01-20141216-0427
We've tried it on a couple of different models, an iPhone 4s running 8.0.2, and an iPhone 5 running 8.1.2.
Edit based on the edited question:
Tag-based notifications do not require any login, as it is the device that is to be subscribed to any tags that you define in application-descriptor.xml; it is not login-based, so any type of login that you are doing it irrelevant. The push will be sent to any device (app...) that was subscribed to your tag using the subscribeTag API.
I did another test in iOS using a broadcast-based notification (it's basically like tag-based notifications). I kept the app in the background and sent a notification. Tapping on the incoming notification in the notification bar brought the app to the foreground, which then displayed the alerts of the incoming notification.
You can try it with this application: https://www.dropbox.com/s/l2yk2pbvykrzfoh/broadcastNotificationsTest.zip?dl=0
Make sure to place your own .p12 certificate and pushSender password.
I've been trying to understand your scenario... I suspect you've left out something or need to better word the problem description.
Here's what I've tried using MobileFirst Platform 6.3 (no drastic push changes in iOS between 6.2 and 6.3) and iPhone 6 running iOS 8.1.2.
Launched sample push notifications app (which uses event source-based notifications) on device
Logged-in > Subscribed
Quit application
I then sent a notification by invoking the adapter in the Studio
The notification arrived and displayed in the notification bar
Tapping the notification launched application
Logged-in
The notification alerts were then displayed.
I then moved the application to the background.
Sent another notification, which was displayed in the notification bar upon arrival
Tapping this second notification brought the application to the background, displaying the alerts
I then kept the application in the background.
Sent a third notification
In this case, because the application is in the foreground, the notification did not display in the notification bar -- as expected -- and instead the alerts were displayed right away.
If your scenario is different than the above, such as: you're not even using event source-based notifications but rather broadcast- or tag-based notifications, or your application flow differs, etc then please edit the question with a more precise description.
When you edit the question, also mention the following:
Worklight version and build number
Device model
Used iOS version
I am aware of one possible issue (APAR #PI31988) that is currently under investigation, where the underlying native code dispatches the message before the JavaScript framework is ready to handle it, thus no message is displayed. This was found to happen in slower devices such as iPhone 4.
Basically my understanding of push notifications is that they can change tiles and display a message to the user when the app is closed.
What I would like to know is if its the right way to go as the main control method in a turn based mobile game? For example the specific situation im wondering about is if the user has the application open and they make their move which gets sent off to my service could the application then sit and listen for the push notification reply and update the ui/continue with the users turn? obviously if the user moved away it should still do the sort of notification mentioned first that updates tiles/ displays a message but if the apps open it should just use a value in the notification and the user should never know it was a notification, just see the other players move and continue with theirs?
thank you
John Harris
Toast notifications are ignored if your app is already running, unless you register for the ShellToastNotificationReceived event. Your app can then decide how it wants to respond to the toast notification.
As you can see from this quote, if the app is open, it can choose to recieve toast notifications and decide how to handle them.
When the app is running you can also receive raw notifications, which can contain more data than toast notifications.