... but it's not as simple as providing the device ID because of security concerns. ...
FIT Decode Example Application
Opening east_west.fit
Decoding...
OnMesgDef: Received Defn for local message #0, global num 0
It has 7 fields 0 developer fields and is 20 bytes long
OnMesg: Received Mesg with global ID#0, its name is FileId
Field0 Index0 ("SerialNumber" Field#3) Value: 3915777777 (raw value 3915777777)
Field1 Index0 ("TimeCreated" Field#4) Value: 840985667 (raw value 840985667)
Field2 Index0 ("Manufacturer" Field#1) Value: 1 (raw value 1)
Field3 Index0 ("Product" Field#2) Value: 2431 (raw value 2431)
Field4 Index0 ("Type" Field#0) Value: 4 (raw value 4)
FileIdHandler: Received FileId Mesg with global ID#0
Type: Activity
Manufacturer: 1
Product: 2431
SerialNumber 3915777777
Number
TimeCreated Dynastream.Fit.DateTime
I'm struggling with "security concerns".
It's related to privacy issues. I'm not a security expert, but we had engineers from other teams that spoke up when we first proposed exposing the unit ID and gave reasons why it's not a good idea. For example, you as the developer are interested in identifying a particular installation of your app, but the unit ID allows an app to track a particular device. There's a growing precedent across the industry moving away from device IDs. You can google around for more examples, but here's one example that describes the potential risks:
https://arstechnica.com/apple/2012/09/ask-ars-whats-the-big-deal-with-iphone-udids/
I read about App Trial feature and it is completely not clear how it works without Unit ID. If purchased one app, will it be for all devices in customers' account active? What if developer do not want to license app to all?
Is it possible to delete device and add again into the one account and purchased apps will be restored?
What if customer sold device and it was registered to another account, are any apps saved as purchased?
And finally, bad bad news. All of these makes no sense until Garmin allows to alter firmware and load it to device, or do not verify .GCD file signature before load, or allow to start bootblock and flash 0x0E region without signature... Modified patcher that can alter firmware for all possible watches that includes patch for the VM (i.e. always return in getTrialDaysRemaining() or in isTrial() whatever you want) is just a question of time. There is a pefect example with the BirdsEye and Map signature patchers, that already exist for years in PND world. Patch firmware -> install any trial app that will be non-trial.
I read about App Trial feature and it is completely not clear how it works without Unit ID.
I really don't understand any of this: what is .GCG, bootblock and flash 0x0E region....? Are these things that an app developer knows about? I'm developing in Eclipse on W10 for a VA-HR and haven't come across any of this.
One solution might be for the firmware to generate a unique ID by securely combining the watch's device ID and my app's application ID. That way each application on the watch would have a different ID, thwarting the hacker's ability to aggregate the data, but still providing me with the ability to identify my app running on the same watch after a re-install.
But really...what are the chances of watch app developers like you and me getting access to sufficiently sensitive user data and being dumb enough to transmit it, and on the other hand, for hackers to bother to put in the time and effort to go fishing for it?