Acknowledged
over 1 year ago

iOS App: device from IQApp incorrectly returned from ConnectIQ when data transmitted

I have an iOS app that works with multiple devices. I have implemented:

func receivedMessage(_ message: Any, from app: IQApp) as required to receive Bluetooth messages from devices. I am using ConnectIQ 1.5.1. I am testing with the Garmin example app: Comm. using the Send Data function on an Epix Gen 2 device with software version 15.77

When data is sent to the iOS companion app and receivedMessage is called, the IQApp that is passed to the function is inconsistently incorrect. It passes another watch (945) that is also registered in both the iOS app and Garmin Connect but hasn't been powered on in over a year. I can tell this both by dumping the app parameter and printing the app.device.uuid. 

There is no specific correction other than force killing the app on iOS several times which causes the devices and app to unregister and register. 

When debugging the registration of both devices (ConnectIQ.sharedInstance().register(forDeviceEvents: device, delegate: self)) and app (ConnectIQ.sharedInstance().register(forAppMessages: iqApp, delegate: self)), the uuids match what would be expected for each device.

I don't have a problem if the app only has one device registered.

The message is always transmitted correctly.

I can provide more details or code if needed.