简体   繁体   中英

session.isReachable always false in background in watchos

I am using WCSession delegate methods to use watch app in background.

All working fine in foreground but when I put app in background it doesn't responding and after that when I come back in foreground then delegate is called automatically and perform the task.

Spent very long time to resolve this issue and then I get that when I put app in background then it changes isReachable flag to false.

So the question is that, how can I keep isReachable flag only true while app is in background?

I just want to get that when Reachability Change then I want callback of "sessionReachabilityDidChange(_ session: WCSession)" method in background and foreground.

But as I say that isReachable flag is false that's why sessionReachabilityDidChange method is not called.

Thanks in advance...!

Documentation is quite clear about when the flag is true or false https://developer.apple.com/documentation/watchconnectivity/wcsession/1615683-isreachable

Nothing you can do to change it, except if you are "running with a high priority in the background (for example, during a workout session)"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM