Why doesn't ServiceDelegate.onPhoneAppMessage seem to work?

I'm working on a watch app that communicates with a companion phone app. If a phone message comes in while the watch app is closed, I want it to wake up and show the message to the user. It seems like the way to do this is by creating a background service, and then calling `Background.requestApplicationWake` in the service delegate's `onPhoneAppMessage`, and relying on the user to open the app in the dialog.

However, I cannot seem to get the `onPhoneAppMessage` function to ever be called, either in the simulator, and on the actual device. Other background events work fine in the simulator, e.g., temporal events. Phone messages also work fine when the app is actually open, via `registerForPhoneAppMessageEvent`.

What am I doing wrong?

I'm testing on a Venu 3.

My code looks something like:



(:background)
class BackgroundServiceDelegate extends System.ServiceDelegate {
# Works fine in the simulator
function onTemporalEvent() {
Background.requestApplicationWake("Launch from temporal event?");
Background.exit({ "msg" => msg.data });
}

# Never gets called
function onPhoneAppMessage(msg) {
Background.requestApplicationWake("Launch from phone message?");
Background.exit({ "msg" => msg.data });
}
}
  • Receiving phone messages while the app is closed does work -- when I manually open the app, registerForPhoneAppMessageEvents is called once per message. The issue is that onPhoneAppMessage does nothing