0

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?

ccjensen
  • 4,578
  • 2
  • 23
  • 25
Cynexz
  • 187
  • 1
  • 9

4 Answers4

2

I have the same problem - when I run watch app in a simulator it works fine and can send a message with method "updateApplicationContext" from iPhone to watch and the method "didReceiveApplicationContext" works well.

But if you want to run the app in real apple watch device, you need to run the iPhone app first in real iPhone device and install watch app through iPhone's "watch" app, then the method "didReceiveApplicationContext" will work

sKhan
  • 9,694
  • 16
  • 55
  • 53
selaband
  • 71
  • 9
0

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.

Cynexz
  • 187
  • 1
  • 9
  • it Works! But I had to do something else to make it work. Right after I ran the app on my iPhone, I needed to open the Watch app (the one used to manage the apps installed on the Apple Watch) on the iPhone, pressed my app icon, and uninstall and install again my app on the Apple Watch. After that, the communication iPhone-Watch worked perfect, just as in the simulators.... This little problem took me hours of work. – jmoukel Feb 24 '16 at 15:31
0

WatchConnectivity works on iOS 2.0 so are you sure your watch is updated to iOS 2.0?

-2

Just use didReceiveMessage instead.

sharvil111
  • 4,301
  • 1
  • 14
  • 29
Steve Ham
  • 3,067
  • 1
  • 29
  • 36