App not working in Background when iPhone is restarted - ios

I have an app where I have enabled Background mode i.e, Location Updates. The app works in background perfectly until its restarted. Once restarted, the app doesn't get the location updates (The app isn't running). Anyway we can make the app run even after restarting the phone?

Chandan I give you very best solution from the below reference.
Kindly go through this

Related

why does my phonegap app restart if kept in background for long

my phonegap app restarts if kept in background for long. For example if i open my app the next day it relaunches rather than starting from where i left off. Otherwise it seems to preserve state perfectly.
I see this happening for some other apps too that are installed on the iphone like instagram, twitter, but not for facebook and whatsapp. Does iOS kill apps if in background for long? Can i prevent this?
I am using Phonegap CLI 6.0.1 (cordova build version 4.0.1) testing on iOS9. Let me know if any other information is needed. Thanks!
iOS will kill apps when it needs the resources. There is nothing you can do to prevent your app from being killed (by iOS or the user). This has nothing to do with your app being made with phonegap (or anything else).
You need to code your app to handle being killed. When the user chooses to use your app again (after it happened to be killed), your app should launch right back to where it was, restoring its previous state. This is what all good apps do.

Do location services not update on someone elses test iPhone?

I am not getting background updates on another test iPhone. I have an application built and running fine on my own test iPhone. The simulator works fine as well with testing. Both can keep pulling the location services while in the background. I test this by spitting the lat and long into the debug area. Even when in the background, both spit the lat and long and keep chugging through.
When I put it on my roommates iPhone to test it, it does not keep updating in the background. Other than that, it works fine. I went into the development part in his settings and could not find anything there either. Is there something I am missing with allowing an the app to run in the background?
Go to Settings -> Privacy -> Location Services (should be ON) -> Name of your app (check if you allow using location)
Check Background App Refresh setting in Settings/General
Apple - getting the user's location
When a user disables the Background App Refresh setting either
globally or for your app, the significant-change location service
doesn’t relaunch your app. Further, while Background App Refresh is
off an app doesn’t receive significant-change or region monitoring
events even when it's in the foreground.

iBeacon Region monitoring: Not resumed when rebooting the phone EXCEPT if I set location background mode?

all day I tested the monitoring of beacons my app does. in general it works ok:
notifications in foreground work
notifications in background work
BUT
after a reboot it doesn't work until I launch ANY app that uses BluetoothLE
after I do that it works fine for my app as well!
But if I set UIBackgroundMode location in my plist though, my app gets region notifications just fine even after a reboot.
So... is that it? or whats the deal here? :D
this is under ios 7.1.1 btw
The code is very minimal:
https://github.com/RadiusNetworks/ibeacon-background-demo/blob/master/BackgroundDemo/BDAppDelegate.m
I did two things:
First, I reduced the time it took the app to launch >> mainly by doing stuff only when the app moves to the foreground. That was Step 1 but for the real app I was working on that alone was only half the solution
I then found out that the application in question tried to access the keychain in the background while the device was locked I moved that to a later point too and BING it worked!

Continue location updates after iOS device is rebooted

In iOS7, will an app that has requested continuous location updates (not signification changes/ region monitoring) be relaunched after a reboot?
When I reboot my phone, the app is suspended, then terminated. When I restart my phone, the app stays in the terminated state until I manually start it.
I've tried adding a background fetch with minimum refresh intervals to relaunch the app, but that's never called either.
In the apple doc it explains that if I enable significant location changes, it will launch my app from a terminated state, but does not mention anything about continuous location updates.
Any recommendations on how to get my app to continue receiving updates after relaunch?
I don't think this is going to be possible because its no use if your app launches in the background anyway because the monitoring for location updates initial request HAS to be made while your app is in the foreground.
If this request is made while the app is in the background then it doesn't work. You somehow have to get your app into the foreground so you can start the process of getting updates again.
You could add significant location changes temporarily as an experiment so that your app gets woken up and then see if you can get location updates once your app has been launched into a background state but I'm 99% sure you won't be successful.
I have tested for many months, the only possible way for iOS to relaunch the app for new location updates after the app is terminated/suspended is using the locationManager method startMonitoringSignificantLocationChanges. If you use startUpdatingLocation, iOS will not relaunch the app for you and hence the app can not get the location update.
If you want to understand the details about the differences between getting location update in the background vs getting location update even when the app is kill/terminated/suspended, please see:-
A) Getting location update when the app is In the background, please see: Background Location Services not working in iOS 7
B) Getting location update when the app is suspended/terminated, please see: How to Get Location Updates for iOS 7 and 8 Even when the App is Suspended
I have written 2 very long article explaining the different between the 2 scenario. The source codes for the above 2 scenario are also available on the GitHub.

iOS app auto-start

I am working on a VOIP app and need it to auto-start when the iPhone starts up. Everything works 80% of the time. But 20% of the time the app fails to startup. One test scenario is the following:
Open app and type something and save
Reboot phone
Check if app is running by double-tapping the home button but DO NOT open the app.
If app is running, reboot phone again and see if the app comes up again in the background process.
This scenarios works most of the time but not always. Other scenarios also fail at times. Can someone clarify if there is a fool-proof way to start a VOIP iOS app every time the phone boots up?
Thanks.
No, it can't be done. If a user force quits an app, it stays force quit. That's how apple want it, and that's how it's going to be. You can't circumvent the users wishes with multitasking. Also, it's worth knowing that what you see in the fast switcher is not necessarily everything that is running, it's what ios thinks the user should expect to be running ie it may shut something down in the background of its own accord in order to free up resources, but because the user did not initiate it this app will appear to still be open in the switcher, despite that it is not.
Sorry, you can't open an app on startup. You should include a reminder on the app's first start up for the user to keep that app open in the background.

Resources