0

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

Punit
  • 3
  • 3

1 Answers1

0

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

Shadowrun
  • 3,572
  • 1
  • 15
  • 13
  • how can I use workout session to run code in background? Any idea? – Punit Jul 02 '21 at 10:58
  • I just want to get reachability change in background and foreground. – Punit Jul 02 '21 at 10:59
  • WCSession reachability won't change when the watch app is in the background, because for it to be reachable, the watch app has to be in the foreground. – Shadowrun Jul 02 '21 at 11:38
  • Ok, so how can I get callback in background ? or How can I use workout session to get call back in background? In all of this case I just want callback method while watch app is in background. – Punit Jul 02 '21 at 12:30