I know there are already some similar questions on stack overflow, but i am not clear from these.
I am working on taxi app. I want to send the coordinates of driver to server even app is in background. I am able to send coordinates to server for 10 minutes but after 10 minutes it stops.
I have check the apple doc, there is written that location based apps can execute in background.
Can anybody help me how can i upload coordinates of driver to server in background?
Follow the line:Project->Tagert->Capabilities->BackgroundModes,check right the item "Location updates"
Related
I am doing a small application for iOS (with Qt and Native code)
I need send my position twice a day to a server (user REST API)
I have no ideas, I do not understand how I could launch a recovery twice a day in a service without my application being on.
Do you have any examples / suggestions to help me?
So far the solution I have found is to use the "background fetch" but I don't know if it is usable when the application is closed and not only in "background". And I also don't know if it's possible to use the locationmanager in this case. https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/updating_your_app_with_background_app_refresh
Thank you
Background fetch wouldn't work if the app is terminated by the user instead of being in a suspended state in the background.
The same goes if you are using background location updates. https://developer.apple.com/documentation/corelocation/cllocationmanager/1620568-allowsbackgroundlocationupdates
I haven't tested if this would work but you could try setting up a silent remote push notification and send it to your app twice a day, then when the app wakes to deal with the notification you get the users location.
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app
This question already has answers here:
How do I get a background location update every n minutes in my iOS application?
(14 answers)
Closed 4 years ago.
I am trying to get the users' location updates and send it to the server every 1 minute in the background in iOS.
The app needs to keep track of the driver’s position continuously similar to Uber and report it to our server every minute.
I tried background fetch and background locations and it runs fine for 3 minutes and then stops.
How do we accomplish this? Please advise.
Thanks in advance!
you cant accomplish exactly that, since An app cannot just run in the BG for a continous interval. (Exception for Bluetooth (sometimes) and Audio or VOIP
look for another way to do it:
==> besides background refresh, def. look at significant location updates (!) [Getting user location when app is in background. IOS
NOTE: This app I am working on is completely for my own usage and will not be on app store so please don't give answers referring that.
I want my app to do some process in background or after termination (double tap the home button and swipe the app from applications multitask) every few minutes. The process is very very light and quick so it won't drain the battery. This process shouldn't require internet connection. I have seen some answers here like and I will explain what are the problems:
VoIP. The problem with VoIP is wither it should be in background to use UIApplication.sharedApplication().setKeepAliveTimeout(..) method which doesn't work when the app is terminated or it should be connected to the internet to establish tcp connection and receive commands from sever and as mentioned before I want it to be internet independent.
Location Services. I found this excellent site with some great articles but the problem is it only works when the mobile phone is moved more than 500 meters. It depends on the location movement so when the phone is staying somewhere there will be no code execution.
Playing an silent audio loop. The problem here is if the user plays another audio (which is completely possible like music or phone call) the app will terminate!
Jailbreak Launch Daemons. I can't require jailbreak so it should be solved with a non-jailbreak solution:(.
I am free to use any kind of private-API's and there will be no restriction for that.
Thanks in advanced
I also faced with such problem, and don't find any solution.
The main problem is if user manually terminated app - in this case you can't do nothing...
Only way is:
a) use Location Services (as you mention)
b) use Push Notifications with background fetch
This question already has answers here:
Receive accelerometer updates in background using CoreMotion framework
(2 answers)
Closed 7 years ago.
I have an iPad that stays on my table at home all day while I'm at work. With my kids around (who are prohibited from using it), I was wondering if I could design an app (or download it, but I did not find it) that would alert me if the device moves.
For example, if one of my kids pick it up, it would detect it through the accelerometer and send me an email.
Is that possible to do with the application not running, but just installed? Like if it was running in the background. I know it is possible with the GPS, but I'd like to do it with the accelerometer to make it detect small movements.
Thank you for your help
Your problem has been issued in several threads all over stackoverflow.
Next time you should really use the search function or at least post some code.
In the meantime check this:
From this thread Receive accelerometer updates in background:
You can not only use accelerometer for fatching data from background,
And as you say your App registers for location updates , start
location manager in forground.
Implementing Long-Running Background Tasks For tasks that require more
execution time to implement, you must request specific permissions to
run them in the background without their being suspended. In iOS, only
specific app types are allowed to run in the background:
Apps that play audible content to the user while in the background,
such as a music player app Apps that record audio content while in the
background. Apps that keep users informed of their location at all
times, such as a navigation app Apps that support Voice over Internet
Protocol (VoIP) Apps that need to download and process new content
regularly Apps that receive regular updates from external accessories
Short Version: It is not possible to ONLY get acceleration data in background.
I am also developing a continuous GPS update within n minutes. The problem is complicating when I also need to send that GPS coords to my Web Service. Is it possible? I read somewhere that it's impossible to use internet service while in Background mode. I got some idea from here: How do I get a background location update every n minutes in my iOS application?
Regards