After several iterations and testing, this is what appears to be true. And proper implementation is important to not create a Denial of Service attack on others...
- You can write to the Activity FIT file more than one SESSION String from within your CIQ app. But the total pre-allocated size of all your strings can't exceed 32 characters. That can be in one string or split among many.
- The Label and Units resource strings associated with these don't count as part of the Session String lengths... so only include actual variable data in the strings.
- If multiple CIQ apps save Session Strings to the FIT file, Garmin Connect will still only respect up to 32 characters total in the post-activity report, so if you pre-allocate fields, you'll be preventing other CIQ apps from having their Session Strings show up in the post-activtiy report.
- It isn't clear how Garmin decides which Session Strings to publish in the report, if there are multiple apps that write and the total exceeds 32 characters.
- A good implementation should therefore setup a User Setting to allow users of your app to turn on or off Session Strings.
- This flag should be used around the "create" AND the "setData" commands, since just pre-allocating the fields will consume those limited characters, even if you don't actually write to the fields.
if (UserSettings[SUMMARY_STRINGS] == true) {
FIT_SUMMARY_HYD = createField("HYDRATION STATS", 1, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 12} );
FIT_SUMMARY_CAL = createField("CALORIE STATS", 2, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 12} );
FIT_SUMMARY_TEMP = createField("TEMP STATS", 3, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 7} );
}