How can I pass data from background process' onPhoneAppMessage to foreground?

In my BackgroundDelegate I get the messages sent from the android companion app in:

(:background_method)
function onPhoneAppMessage(msg as Communications.Message) {
    Sys.println("onPhoneAppMessage: " + msg.data);
    // how can I save msg.data?
    // how can I trigger Ui.requestUpdate()?
}

I tried the same that works in onTemporalEvent:
Background.exit({"msg" => msg.data});
but I get this error:

Error: Unexpected Type Error
Details: Failed invoking <symbol>

And also I can't use App.getApp().setProperty("msg", msg.data) because I get this error:

Error: Unhandled Exception
Exception: Background processes cannot modify the object store

Top Replies

All Replies