Detect iPhone disconnected from WatchOS app in background - ios

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?

Related

From WatchOS App connect BLE device using iPhone Bluetooth

Hi everyone here it's my problem, I have an simple app on my Apple Watch and iPhone. All my goal is using iPhone minimum on the App. Instead of iPhone App I want to use this App mostly from the watch. So I have an UI screen consisting with 2 buttons (Scan and Connect) on the watch. And these buttons should control the iPhone's Bluetooth. I don't want to use Watch Bluetooth. Considering all, is it posibble to trigger the iPhone Bluetooth in background from Watch and connect iPhone to a BLE device.
I think I fix this problem with your help guys;
Hi again, I believe I can fix this problem with the background transfers. Let me first explain the problem better when I want to use iPhone App local database and also want to use iPhone's Bluetooth from the Watch App I had trouble. And then I noticed sending messages from Watch to iOS wakes up iOS in the background (Source for more detail). In this way I'll have using iPhone app only in background and even scan BLE devices from the iPhone in bg and send them to the Watch App (WC Sessions).
Source (Communicate with iPhone and Watch)
https://medium.com/#jackywangdeveloper/apple-watch-communication-with-iphone-af84d51ff810

How to run watch app on background mode location update

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...

App is not working in background on iOS 10.1.1

I am working on chatting/calling app. To make it work in background mode I've enabled these modes:
It is working very fine with iOS 9.3.4, iOS 10.
Working means it is receiving messages, calls, responding to server when in background, even though there is no call is in progress.
When I run it on iPhone6 with iOS 10.1.1, it is stopping responding when enters in background.
Anyone faced this anytime? Any workaround found?
I am using Xcode8.2 Beta
I also tried enabling Background Fetch mode, but didn't helped!
UPDATE
It is working in background only when any call is in progress on iOS 10.1.1.
Actually I gone through various reads on net, it says that iOS10 is stopped supporting for background app execution for VoIP apps.
To run VoIP apps in background, there is no way.
My ap was running in background on iOS10 was because I was building it against iOS9 SDK on Xcode 7.
Only one thing we can do is use PushKit Framework and get VoIP silent notifications to awake the app in background!

iOS / WatchOS - Monitoring the connection between Apple Watch and iPhone

I am trying to get a notification on iPhone when the connection is lost from my Apple Watch.
My first approach was to check the session.paired==true which works fine when the application is on foreground. But I would like to receive that event when the app is on background.
Then I thought about the Background Modes of the iOS and that there is a mode for external-accessorythat will send a notification on the device when is connected or disconnected. Is there something similar for watchOS?
My other idea is again with background modes and Bluetooth. Can you detect the watchOS as bluetooth?
Did anyone solve this issue?

Implement WatchApp for already existing iPhone app and want api calls to happen on iPhone app in background mode

I am implementing WatchApp for already existing iPhone app and want api calls to happen on iPhone app in background mode. Please suggest how to do it.
My iPhone code is in Obj-C and want Watch code to be in Swift.
For the network queries from Watch should be handled on iPhone in background.
Is it possible and how?
You can call WCSession.sendMessage in your watch app.
When your iOS app is reachable, the corresponding WCSessionDelegate callback method is called even when your app is in background. (works fine in my App).
When your watch app is not reachable, sendMessage is thrown away. When the your iOS app answers and it is not possible to transfer the answer to the watch, the answer is thrown away.
P.S.
As Apple suggests, do the iOS implementation in your AppDelegate. If you do it that way, your app can answer in background when no UIViewController instance exists.

Resources