I have a Garmin Data Field which works with our iOS and Android apps in order to display numerical fitness metrics provided by my company's product. This works well for CIQ 5.0+ devices (x40/x50 gen newer then ~2022). But some users have older devices which I would like to support.
I am using web requests to query my app through the Garmin Connect app on the users phone. My Android app broadcasts to a port on the localhost which Garmin does not restrict. This doesn't require internet access, and although the structure is not majestic it seems fine for my needs.
How can I support real time (once per 5 seconds or better) metric streaming to an older gen bike computer from my Android and iOS apps? It would be nice but not required to work on watches too.
I attempted to implement the message method from the Garmin SDK but I think that might be only for watches not edge computers? Or not for data fields? The API lists function api-docs/Toybox/Communications registerForPhoneAppMessages(method(:phoneMessageCallback)) as supporting edge devices since API 1.4.0. However this function is a syntax error using the Monkey C plugin for VS Code with my settings, and a forum post "On Communications.registerForPhoneAppMessages by Nik over 6 years ago" notes support was removed in API 2.2.2 and maybe never worked. The table for enabled app types (connect-iq-basics/app-types/) declares Toybox.Communications is supported for Data Fields in API 5.0.0+ but this function still does not compile when targeting API 5.0.0 for a Data Field on a Edge 840.
Supplemental technical information:
I marked all bike computers and watches as supported in the manifest.
I test with a Edge 840, or Edge Explore (2018).
iq:manifest version="3"
minApiLevel="3.0.0"
<iq:uses-permission id="Background"/>
<iq:uses-permission id="Communications"/>
<iq:uses-permission id="FitContributor"/>