Reopen my Flutter app in background on FCM message - android

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

Related

Notification service is running (always)

I hired a developer to build an app for me, I noticed this issue and he said he doesn't think (or know how) it could be fixed. The issue is that every time my app is launched and you're logged in, this notification appears and stays there even if you close the app, you cannot swipe to remove it, you can either remove the app or kill it, or reboot the phone. Any idea how to fix it, he's using "Pusher"
Here's the example after launching the app
You have to manage your service so that it can be started and stooped as per your usage.
Please post the code or connect with me # napsterkr#gmail.com for further help.

how to Launch Cordova app when phone locked

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.

How to make an Android app running all the time

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

programmatically temporarily disable auto-update

I have a Bike computer app that logs data while the user is riding. I have had a user report an issue I had not considered. He was out for a long ride (100+ miles) but while out and logging data the app got updated via Google plays auto-update. This unfortunately killed off the app mid recording and the user lost data till they spotted what had happened and restarted the app.
Ideally I would like to be able to programmatic stop the auto-update happening while the app is data logging. All my research indicates that this is not possible possible but I may of missed something so dose anyone know of a way of doing this?
Given no solution the best I can do is advice the users to enable the update only over wifi option in the Play app which in this instance would of helped. Unfortunately one of the key points about my app is that it will log indoor sessions using ANT+ sensors so I have a good number of people using it with wifi active.
Edit
I managed to do the experiment to see what happens myself last night. I had an app going in the background data logging then pushed a new version to Google Play. Unfortunatly it was not picked up totaly automaticaly when I had to leave 10 hours latter but I opened up the play store app and it found the update it did not start updating automaticaly but I forced it. The act of downloading and installing the new version killed off what was in progress. It was already dead before I used the notification to go to the new version.
As you say yourself, you can't do that what you are asking for. You could hack your way around it by changing the permissions each time you update. The users will then be prompted about it in the regular way.
I'm not sure about the "life-cycle" for automatic updated apps that are running. But I read somewhere that is wasn't the re-install but the reopen of the app that crashed it. If that is the case you could set a flag indicating that the user is currently logging and then on restart just resume the logging. But again we need to know more about the inner workings of activities/apps which are running and get an automatic update (actually didn't think it could happen).
Edit
Based on your findings I'd say you have to handle the app is shut down in onDestroy etc. or/and make sure you save everything persistently. Then you might need to have 2 apps where 1 listens to the other being re installed and when that happens it starts it up again (there is an interesting discussion here). If you are targeting api >= 12 then the broadcast action ACTION_MY_PACKAGE_REPLACED might also have interest.

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