Navigation stops after 15 min in background skobbler - ios

I am using Skobbler sdk in my application for navigation. I need to continuously send data of navigation to other device. But the navigation in background works for only 15 minutes after that it stops navigating in background. I have also tried enabling the following key value pairs in plist :
Required Background modes-
1. App registers for location updates
2. App downloads content from the network
Please suggest some help.

Please test this in a real situation, like actually driving while using the app with navigation type being SKNavigationTypeReal.
Background apps are suspended after some time and only activated when they actually receive GPS location updates. Your app will never resume if the device is not actually moving.
This is an optimization done by Apple to improve battery life.
Some more info about background modes:
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html
The next release will include an API to disable this behavior.

Related

How to continue monitoring iBeacon when screen is off in iOS?

I am developing an iOS app to monitor iBeacons. It works well in both foreground and background. I also need it to keep monitoring even when the screen is off. Now my problem is, when I turn off the screen with the shoulder button, NSLog shows that the iBeacon signal goes off (RSSI=0, beacon.accuracy=-1.0) accordingly, and 10 seconds later, there is no beacon found at all, while the delegate method locationManager:didRangeBeacons:inRegion: is called continuously. It seems that the app is running when the screen is off but iOS turns off the location service for iBeacon ranging. I tried to set "locationManager.pausesLocationUpdatesAutomatically = NO;" but still doesn't work. Is there any advice on this issue? Thanks in advance.
It seems that you're doing ranging instead of monitoring. Ranging only works when the app is active—either in the foreground or in the background. The catch is, iOS will automatically put an app to sleep a few seconds after you navigate away from it, or lock the screen.
What you have to keep in mind is, there's really no such thing as "permanent background state" on iOS. Apps run in the background for some limited time while transitioning to the suspended state (to let them, e.g., finish uploads/downloads), and there are also Background Modes that sometimes enable an app to run in the background, but these are usually reserved for very specific apps—e.g., the "audio" Background Mode means an app can be running in the background as long as it plays music, etc. There is a Background Mode for "location" services, but it's reserved for turn-by-turn navigation apps.
Beacon monitoring however continues running even if your app goes to sleep, or gets terminated by the iOS due to memory pressure. When you go in or out of range of a beacon, iOS will launch your app into the background to handle the event, giving it a few seconds (which you can extend up to a few minutes with a Background Execution Task) to do so (you can range during that time), but then it's back to sleep.
You might also want to take a look at this question:
Receive signal from beacon while app is in the background

Location services switching off in background in iOS

I have enabled background mode for location services in my app, but when I send the app to the background, it seems that the location services are switched off after a few seconds (the arrow of location services in the device's status bar disappears). I'm not programmatically stopping the location manager, and I'm using standard location service with its best accuracy.
What can I be missing?
Thanks in advance
For iOS 7 and above, When the app is on the background and not executing code. Normally, the system will move app from background mode to suspended mode automatically without any notification. When you app is in suspended mode, you can not do anything (no location update).
In order to keep the app active in the background for iOS 7 and above, you will have to know when to restart the locationManager.
I have a blog post with a detail explanation and also a complete solution uploaded to Github on how to keep the app active in the background, please check this post for more details:- Background Location Services not working in iOS 7

iOS - show consistent alert at the top of the UI when backgrounding the app (like personal hotspot does)

I am creating an alarm clock app that requires some user action within the app in order to turn the alarm off. Below is a picture of what another app, Sleep Cycle, does when you turn an alarm on and press the home screen (i.e. background the app).
Here is an image link (I can't post an image yet, no rep despite my many attempts to answer people's questions today) for the effect I want to re-create.
Those that have used iPhone's Personal Hotspot and connected a device will notice that it is the same effect, where a notification appears at the top of the UI - pushing everything down by around 20-40 points. This is highly desirable to an alarm clock app as it encourages the user to keep the app in the foreground so that the app can easily be entered when waking up (instead of relying on the 30 second sound window allowed by local notifications)
Does anyone have any ideas on how to implement this functionality. I assume that it must go somewhere in the:
- (void)applicationDidEnterBackground:(UIApplication *)application
tag within the AppDelegate, but I'm not sure what exactly I need to be reading up on. So if anyone has a link to some relevant Developer Docs that would also be extremely helpful.
Many thanks for your help,
Ryan
There are a handful of built in 'background modes' that change the status bar's appearance depending on what functionality an app provides whilst it's in the background. The one you've identified (a red status bar) is triggered when an app records audio whilst in the background. I presume Sleep Cycle must be acting as though it records audio just for this purpose. Other background modes include VoIP (which I think uses a blue status bar). Check out Apple's documentation on supporting these various background modes
In your case, you'd want to add audio to the UIBackgroundModes property in your Info.plist file.
But note that it wouldn't be unreasonable for Apple to reject an app during review if it pretends to perform one of these background tasks but doesn't. For example, there have been apps in the past that tried playing a silent audio clip continuously in order to stay awake in the background - needless to say Apple got wise to this and the app in question had to change its behaviour.

How does Moves app work on iOS

Moves app on iOS geolocates your movements throughout the day even when the app is inactive. In addition to this it also appears to analyse core motion data to identify if you have walked, cycled or taken another form of transport (walking with your phone in a suitcase on wheels reports as a cycle).
What iOS methods and techniques can the Moves app use to continuously capture this data without the application having been open? Geofencing? Background processes?
You can register an app to continue operating in the background. Have a look here at the Background Execution and Multitasking section. http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

Monitoring Significant Location Changes, App closed GPS signal (Arrow)

First of all I hope don't repeat any topic, I have spent a lot of time reading on internet about this before ask.
I'm developing an app for iOS => 5 and I need get the user location, but I don't need always a great accurate position, so when the app goes to background I change the normal location mode to Significant Location Changes and when the app come to foreground I stop the significant location change mode and get back the normal location mode, that's all goes fine,
my problem is when the app goes to background mode or even the user KILL the app the GPS signal (the purple arrow) still appear ALWAYS, even after restart the device, the only way to make disappear it is un-installing the or disabling the significant location changes when the app goes to background, but I need this mode working when the user goes to background mode, maybe not when the app is killed.
I don't know how to stop the service when the user kill the app... because event "applicationWillTerminate" is not called if you have multitask ON.
My main reason because I don't want the purple arrow appear always, even the app is killed is because I don't want the user think the app is drying the battery... so the user won't want the app installed.
First question: Is normal that the purple arrow appear always, even the app is killed if the Significant location change is enabled for the app?
Second question: Is any way to change this, to stop the service at least when the app is killed to hide the purple arrow?
Thank you all.
Sorry for my english if something is wrong.
After few days researching to be sure about this service, seems like there is NO way to use significant locations change in the background without the arrow in the top bar. I have been testing with different apps and reading through internet and nothing to solve this.
The only ""way to solve"" this is disable multitask mode in the app and disable the significant locations change in the event "applicationWillTerminate" but don't make sense... I'm losing the background location always not only when the app is killed... so is not useful.
It's bad... is a really good service to get locations saving battery but as user and developer I don't want an app that make appear this icon ALWAYS even after the app is killed, as developer I don't want that people uninstall the app for this reason and as normal user I don't know what mean this icon if is normal GPS or Significant locations change and what mean this... if my battery is being drain or not.
The other option to get locations in background task but has a big impact over the battery....
I hope apple fix this in future versions... adding at least a new arrow or showing only when a new location arrive instad of always or allowing to stooped when the app is killed.
All this has been researched over iOS - 6.1
Thanks to all.
When you use the significant location change service, the OS keeps your app running. If the app is in the background and is killed, the OS restarts it, so the purple arrow will always show. When a new location is detected, the app is restarted. From the docs:
If you leave this service running and your app is subsequently suspended or terminated, the service automatically wakes up your app when new location data arrives. At wake-up time, your app is put into the background and given a small amount of time to process the location data. ... To stop the significant change location service, call the stopMonitoringSignificantLocationChanges method.
Hmmm, interesting. I've just seen that problem with another app - seeing the arrow still active made me want to disable location updates for that app so the problem is real. Best thing I can think of is to have some kind of timer to disable the location monitoring after a certain amount of time if that is appropriate for your app.

Resources