Punit
Punit

Reputation: 3

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

Upvotes: 0

Views: 981

Answers (1)

Shadowrun
Shadowrun

Reputation: 3867

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)"

Upvotes: 0

Related Questions