Creating a persistent updating notification in ionic vue - android

Generally, after opening a/the clock app on a phone (at least on an Android), and starting a stopwatch (or timer), when you minimize the app, or even close it, there's usually going to be a persistent notification with the current stopwatch/timer value that continuously updates.
Here's an example GIF demonstrating this
As you can see, in the GIF, (linked above), even if I close the app, the notification displaying the current stopwatch value remains. I can't seem to find any info or examples on how I would do something like this with Ionic, or even if it's possible.
Both the Capacitor LocalNotifications plugin or the Cordova one have the option to schedule repeating notifications, but it doesn't seem like I can change the text value of the notification on each repetition.
I've also looked into the BackgroundMode plugin, thinking that maybe I could just keep sending new notifications each second from the background, but that only seems to allow me to run background tasks while the app is minimized, not when it's closed also.
So, is it even possible to display persistent updating notifications with Ionic, and if so, how?

Related

Reopen my Flutter app in background on FCM message

all day I already despair of a waking up system for my VoIP app. I must have already read over 100 articles and documentation about it, however I have not found a solution that works for me.
Use case:
My app is running in the background. That means the home button was pressed
after my app was started and the device is in the home screen. As soon as a notification arrives, the app is supposed to open again on a certain route because a call is coming in.
In the lock screen I managed this pretty easily with flutter_local_notifications and within the app it was of course no problem either.
Note:
Only Android is important, the rest can be neglected
Android version 10+
Flutter version 2+
I appreciate any input on how to solve my problem and have a good week.
Kind regards,
Shiro

Flutter app stay running while in background

I have an app I have building that is giving navigation from a location to a location. Contstantly tracking where the user is using GPS data in order to give good Directional information. Currently if a user switches from our app to another app or goes to the Android home screen, after one minute Android turns off our app for performance reasons.
I have tried using an Isolate but like flutter this gets shutdown. Next step were to use a kotlin service to handle background things but i wanted to check if anyone had done this in dart yet?
Also this is not an app that will be in the play store or on public devices. It is going on special devices that we control and are less worried about memory usage as this will be the main app ran on them.
as mentioned above in the comment by #galloper background_fetch is the thing you need, it has a method called BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask); where backgroundFetchHeadlessTask is a function that will keep running even when the app is close, i used this in my app to stream location info to server.

Background periodic task and notification showing

I was looking online for the best solution but couldn't find exactly what I wanted.
So, I am developing an app using React Native, and trying to make it so that even when the app is closed, once an hour a background task (which will do some fetching) will run, and at the end of it a notification (not a push notification) with a custom message will show up.
How can I achieve that?
Thank you upfront.
For Android you can use Headless JS which ships with RN. For iOS you'll need a package like react-native-background-task, which works with both. Android only projects you're probably better off just sticking with Headless.
You'll need react-native-background-task to perform the task you wish like fetching every hour, and then using some notifications library(i prefer firebase), you can show the notification to the user screen.
Also in firebase there is scheduling-notifications with which you can schedule notification showing on the screen (maybe you find a use case needing it).

Are android apps still running in background if I am getting notifications?

Here is the thing, I am not used to the latest android yet and the new system is giving me some confusions. Usually, for the older androids, if I close all background apps, I won't get new notifications from them. But after switching to a new phone with the latest android, I realized that even if I do close all background apps, I still keep getting notifications from them. So, how are the apps still pushing notifications if I already close them from background?
(Say google maps for example, I am 100% sure I killed it in background but now it keeps notifies me about my live traffic status on my notification bar.)
So Here's the answer-
Yes, they are. Whenever the Internet is turned on or you get a message, listener of that app wakes up and check for any notification and if there is something new, it shows you the notification.
These apps keep running in the background if not put in sleep mode by your phone and use the resources.
Like you don't want to get notified by WhatsApp for a new message but the moment you change the network, unlock your phone again or turn the data on, an event listener will wake up and notify you of new messages.
Also, wake timers are used to notify you after some fixed time like after every 5 minutes.
This is the thing I hate the most.
Not promoting but here's the app - search play store for Shutapp - Real battery saver (Blocked from Play store a while ago and doesn't work anymore for "obvious" reasons). It will turn off all the background apps and you'll be amazed to see a long list on first use.
This will remove all the apps from background until you open them again. I use this app most of the time and it really works great.
Try this out.

Notification in Phonegap While App is not running

I am working on an app with PhoneGap on android where the user will get messages every now and then bringing them to one of the pages on the app. I've looked at a few possibilities but haven't found any simple way to do this. Can I use the built in Notification on the Phonegap API to do this?
I have found a few good ways to do push notifications like thisw: http://www.pushwoosh.com/programming-push-notification/android-push-notification-for-phonegap/ but I want the notification to be coming from the app itself with the time determined by a built in timer.
Thanks!
You can't, not in Phonegap anyway. If the user leaves the app with the Home button, then the code is still running (until it gets killed when memory gets low). But if the user exists with the back key, the app dies. See here: Creating an Android Service with Phonegap? (Have phonegap app run even when closed)

Categories

Resources