I have written an android app in kotlin that sends data to my Fenix but I'm struggling to unpack the data in the watch app.
The data is two arrays of string contained in an array
In the watch app I am using the following code.
function initialize(view) { BehaviorDelegate.initialize(); if( Comm has :registerForPhoneAppMessages){ var phoneCallback = method(:onReceiveMessage); Communications.registerForPhoneAppMessages(phoneCallback); } else{ System.exit(); //todo } } function onReceiveMessage(msg){ // what to do here? msgs = msg.data[0]; contacts = msg.data[1]; state = new State(contacts, msgs); var loadingView = new ContactView(state); var loadingDelegate = new ContactDelegate(loadingView); WatchUi.pushView(loadingView, loadingDelegate, WatchUi.SLIDE_IMMEDIATE); }
The callback receives a msg object but what type is it?
Can I access the array passed from the phone app by using msg.data?
Can anyone point me to a working example of passing an array from a phone app to garmin device?