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)
Related
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
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?
I am looking to have my Android (Flutter) application running in the background, checking what app is currently running in the foreground.
When a certain app is opened (eg: Snapchat), I would like to redirect the user BACK to my application.
I've seen native android code that can accomplish this, but I was wondering if there were any Flutter-specific plugins that can accomplish this goal?
I'm aware that you can grab a list of currently installed applications using Flutter, but is there a way to see which app is running in the foreground and then redirect back to my own application, or is this something that would have to be done natively?
I am working on an android app built on apache cordova. The app used to send your location via SMS, Email & in app notification to your predefined contacts. I want this sharing event to be triggered on double tapping on screen (when locked) or 3-4 times pressing the power button/ volume button.
Its for emergency situation, when user may not be able to unlock phone & open app to share any info.
I've searched a lot but could not find any relevant info. is there any available plugin to do that? I know very little of JAVA. Expecting any plugin that would allow me to launch the app(any activity) when phone is locked.
Any helpful information or suggestions are appreciated.
To accomplish this kind of task, you need to run a service in background, it is not possible to use any cordova webview, so you won't be able to run any javascript.
I don't think there is any plugin doing such a thing as it is very specialized.
I needed to create an app that needed to send notification to the user depending on his location. It ended up in writing a native plugin...
So the best advice I can give you is "It's never too late to learn Java" ;-)
maybe some other JS framework (maybe NativeScript) allows such things but I never used it yet so it might be impossible too.
I am makin an android application on Emergency communication.I want my application should run all the time and whenever it needs it should be able to run.I want that user should not be able to close it by any means.Like Google Maps application which is restarted again on killing its all activities and even we force close it,it will be restarted.
Seems you are learning app development ... but this is not the way you should pose question here... you should post what you have done and code issues and not ask for an entire class...
But i will try to answer your question are you trying to create an app which when started wont be able to be closed and come back to home screen ???!!!!!
See you are creating an app which will run on android operating system which is similar to linux so you must follow the Activity
LifeCycle
I remember i created an app where there were shortcuts on screen so using that i was directing the user to specific links but you can use for calling etc.. i donno if that is what you are searching for...
You might create a notification bar if you want which cannot be cancelled and you can place the code in the intent which will be called from this...
Also services are there which u can utilized what other users have suggested...
thx
You could use an extra service running in the foreground, but there will be always a notification of this service in the notification bar.
See here: http://developer.android.com/guide/components/services.html#Foreground