How to run watch app on background mode location update - ios

I was using location updates as background mode on Apple Watch series 2..
my issue is when I removed app from dock or foreground. my app is again re-launching to foreground after unlocking watch.
But I don't want to re-launch app automatically until user manually re-launchig the app. How I can achieve this...
is their any way to handle this...

Related

Detect iPhone disconnected from WatchOS app in background

I’d like to know if there’s a way to detect if the iPhone is unreachable while the WatchOS app is in background. I tried to connect each other with CoreBluetooth but if WatchOS app is in background won’t call didDisconnected method.
So I tried the trick of update locations to get alive the app in the background, but everytime the Apple Watch screen awakes the WatchOS app is in foreground and the notification won’t works.
I implemented the
sessionReachabilityDidChange but neither this is called in background.
Can somebody give me a hint?
Or can tell me how to prevent the WatchOS app to be in foreground while update locations is running?

Open iOS app in background while switch-on the phone

One of my client's requirements is to launch an app in the background while switch-on the phone. Is it possible to open an app in the background?
I just want to know!!!

why my Ios App is killed by OS in background mode?

hi i have an iOS app that runs perfectly in when i run it through Xcode on my iPhone.when i press the home button and lock the screen, the app keeps recording the data.after 1 or 2 hours when i unlock screen it is still recording data and works perfectly.but when i stop the app , unplug my phone and run the installed app directly through app icon on my iPhone it is killed by the os after a few seconds in lock screen.i have already asked similar question but couldn't find any help.if someone could download the source code and have a look at it it will be very nice of him/her.Thank you
why my Ios App is killed by OS in background mode?
The OS won't allow apps to run for long periods in the background in order to save power. There are exceptions — you can tell the OS that your app needs to run in the background for one of several reasons such as playing music in the background. There are also some facilities for waking up your app in the background to do some processing -- for example, your app can be notified when the location changes.

Launch app from background service

I've developed Android app which has a background service in the sleep mode. This service works with accelerometer data and can launch the app from the sleep mode over the lock screen.
Is it possible to make the same on iOS?
I mean:
Create a service which can work in background with accelerometer data.
Service can launch the app when the phone is in the sleep mode over lock screen. (without unlocking)
If I'm not mistaken it must be possible on iOS7, isn't it?
Thanks!
Yes – Apple publicly stated background processing at WWDC keynote and it can be done to a degree on iOS6
No – Apple will 'probably' never allow an app to be opened without the user instigating it and certainly not over the lock screen.
You could use Push / Local Notifications which do appear on the lock screen to try and entice a user at a specific time to launch the app but no guarantees.

UIApplicationExitsOnSuspend and screen refresh

I have an app that has the UIApplicationExitsOnSuspend info list property set to TRUE.
And now I am noticing a curious issue.
I start up the app and let it run on my phone and do not touch my phone. Eventually the phone screen goes dark and the phone goes into standby mode. When I wake the phone up, what I see is a screenshot of the last screen displayed on the app. (This seems according to spec, since the Apple documentation says that in the process of moving an app to the background, ios takes a picture of the app and uses that for transitions when the app comes back to life). If I double click on the home button to see running apps, I do not see an instance of the app running. (again, working as intended since UIApplicationExitsOnSuspend is set to true).
My question is, how do I make sure that when the phone wakes up, it comes back to the default home screen and not the picture of the app ? Clearly the app is not running on waking up, so there is nothing I can do from within the app that will refresh the screen. I could try to exit when the app is going to background, but then apple guidelines say, never exit programatically!!.
Any ideas ?
You misunderstand what is happening. If you enable UIApplicationExitsOnSuspend, this means your app will terminate when normally the app would go to the background. If you run your app then let the phone sit idle until the screen goes dark, your app is still in the foreground so it is not terminated. When a device goes into standby mode, the current app is still the current app. When you wake the device, you are not looking at snapshot of your app, you are looking at your running app. Double-tapping the Home button at this point doesn't show your app because your app is the currently running app.
Your app will be terminated if you return to the home screen or switch to another app. But it will not terminate just because the device went into standby mode.
If you want your app to return to its main screen when the device is woken up, then you need to put code in the UIApplicationDelegate applicationDidBecomeActive: method to reset your user interface.

Resources