Hi
I am trying to connect to different devices in runtime in my companion app. I.e., I have two watches with the same COnnect IQ app installed on both of them (Fenix 6 and Vivoactive 3). The goal is to receive messages from Connect IQ app on connected Android Companion app.
It always works fine for the first watch (whatever device I use), i see messages from the watch on Android Companion app. But if I do the ConnectIQ shutdown and then try to connect to other watch I not able to see messages from it. But the connection itself is looks fine. But no messages.
I faced this issue in my Companion app and was not able to fix it. Then I have created small test application to debug it but still no success. My Code flow looks like below
ConnectIQ.getInstance()
ConnectIQ.initialize()
ConnectIQ.getConnectedDevices()
ConnectIQ.registerForDeviceEvents()
ConnectIQ.getApplicationInfo()
ConnectIQ.registerForAppEvents()
On device switch I call code below and then code above again:
ConnectIQ.unregisterForDeviceEvents()
ConnectIQ.unregisterForApplicationEvents()
ConnectIQ.shutdown()
I double checked the code multiple times but still not able to get it work. The code always works for the first watch I connect (I see the messages from watch). But once I did shutdown() and try to connect to another device the messages from the device are never come. Only the Android phone reboot can fix the issue. If I try to connect to second devices after reboot then I able to see messages from the device. But in this case the first device becomes unresponsive if I switch to it afterwards.
Is this a known issue of the Garmin SDK or it is some kind of SDK restriction?
I think it is a bug in the SDK. Because i set breakpoint in the IQMessageReceiver.onReceive() method. And If I connect Companion app to device A and then switch connection to device B I see that breakpoint hits again and again (messages are still receiving from device A but not from device B). So device A listener was not destroyed and device B listener was never set by CIQ SDK