I’m growing an app the place the iOS app (written in Flutter) communicates with a watchOS companion app. Whereas the principle app is constructed with Flutter, the communication between iOS and watchOS is applied natively utilizing WCSession, so the Flutter framework shouldn’t play a job on this challenge. I structured the communication based mostly on this text https://medium.com/@Toglefritz/building-a-watchos-companion-app-for-flutter-08f80ea8cb1b
The workflow is easy: the iOS app sends a message to the watch, and the watch begins performing duties based mostly on that message. For almost all of customers, this works as anticipated. Nonetheless, a small variety of customers are reporting points the place the message isn’t transmitted to the watch, seemingly as a result of the WCSession will not be reachable.
Listed below are some key particulars:
Setup:
- The iOS app ensures WCSession is activated, and messages are despatched utilizing sendMessage(_:replyHandler:errorHandler:).
- On the watchOS facet, the app listens for incoming messages and processes them accordingly.
Drawback:
- For many customers, the communication works with none points.
- For a subset of customers, the watch app doesn’t obtain the message, and the error handler on the iOS facet signifies that the session isn’t reachable.
- The difficulty is inconsistent and troublesome to breed in testing. I’ve been unable to copy the issue on my gadgets.
Questions:
- Have you ever encountered related points with WCSession communication being unreliable or inconsistent?
- Are there any recognized edge circumstances or situations that would trigger the session to be unreachable for some customers?
- Do you have got any debugging ideas or methods for figuring out the basis explanation for such points?
For the reason that downside solely happens for a small subset of customers and isn’t reproducible on my finish, I’m at a loss for how you can enhance or debug this additional. Any assist or solutions can be tremendously appreciated!
Thanks prematurely!