Rexios80 / watch_connectivity

Wrapper for WatchConnectivity on iOS and Wearable APIs on Android
https://pub.dev/packages/watch_connectivity
BSD 3-Clause "New" or "Revised" License
27 stars 17 forks source link

[watch_connectivity_garmin] Android not receiving messages #19

Open joscha0 opened 4 weeks ago

joscha0 commented 4 weeks ago

I am trying to send a message from the watch to the android app when the user presses a button on the watch.

The connection to the simulator through adb works. But when I click a button the only thing I get inside the console is:

D/ConnectIQ-AdbConnection( 7611): Received 25 from simulator
D/ConnectIQ-AdbConnection( 7611): Looking for input from simulator.

watch.isReachable, isPaired, isSupported all are true

I am listening to the messages like this:

watch.messageStream.listen(
  (message) {
    print('Received message: $message');
  },
  onError: (e) {
    print("message error $e");
  },
  onDone: () {
    print("done message");
  },
);

And sending from the watch like this:

Communications.transmit("test", null, listener);

The function from public function onComplete() as Void { triggers (on the watch). The messageStream onData doesn't trigger.

Does the transmitted data has to be in a certain format? Or is there something else that could cause this issue?

Rexios80 commented 4 weeks ago

Both the watch and phone apps mush have the same bundle identifier. Also the data is supposed to be a map.

joscha0 commented 4 weeks ago

Thanks for the quick reply. For Garmin apps there is no bundle identifier as far as I know? I only have the app uuid which is the same as the applicationId. I also tried with a dict as data but that doesn't work either: Communications.transmit({"data"=>count}, null, listener);

Rexios80 commented 4 weeks ago

Oh whoops I didn't see that you were using the Garmin plugin. Yeah I don't think there is a bundle identifier restriction there.

Rexios80 commented 4 weeks ago

Unfortunately I created the Garmin plugin in collaboration with a company that I no longer work with, so I don't have a Garmin app to test with. Can you open the plugin example project in Xcode or Android Studio and set a breakpoint where the message is supposed to come in? If you need help with that, we could have a call on Discord to debug this.