Search code examples
iosswift2watchkitwatchos-2watchconnectivity

Apple Watch not receiving didReceiveUserInfo on device, but does in the simulator


I am trying to make an Apple Watch app for the first time, and I'm having some problems testing it on the devices themselves.

I have followed a tutorial: https://www.natashatherobot.com/watchconnectivity-application-context/

When I sent data from the phone to the watch in the simulator, I receive the data as expected. I print the data in the console that it has been received.

But when I try to run the app on my own watch, I don't receive any callbacks. I have tried it with: didReceiveApplicationContext didReceiveUserInfo

Both work in the simulator, but not on the device.

If I check if the watch is paired and reachable, it says it is. I have no idea why it doesn't work on the device itself, and have no idea how to find the problem or how to debug it further..

I also can't find anything on Google about it...

Anyone?


Solution

  • I just found out; When you want to test the Watch app on your device, and run it from xcode, you first have to run the app on your iPhone. After it's launched it launches the app on the watch and then I receive the data as it should...

    If I would open the app on the watch first, it doesn't work while debugging for me.