WatchOS app is running in the foreground and can wake up the iOS app, but it can't trigger didReceiveMessage in the iOS app.
iOS and Watch apps in the foreground can communicate with each other without any issues. However, when my app is closed, even though it wakes up, it cannot communicate. Any ideas? Should I be using a background task ios app side?
"Did you do it using sendMessage or transferUserInfo?"
I tried sendMessage
with the following steps:
- Follow the Readme to build and run the sample app on devices.
- Launch the iOS app, and swipe up to push the app to the background and return to the home screen.
- Launch the watchOS app, navigate to the
SendMessage
tab, then tapSendMessage
, and observe the "Replied at <timestamp>". - On the iOS side, bring the app back to foreground, and observe the "Received at <timestamp>" message.
I tried with my iPhone 16 Plus + iOS 18.0.1 and Apple Watch Series X + watchOS 11.0.1.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.