Alarm can not receive uri

Hi,

I set an alarm in the app, both in the UI or the service.

On service “alarmCallback” haven’t received the corresponding callback function from the URI.

Can you help checking the code?

function setAlarm() {
console.log(“setAlarm start:”);
ServiceContext.getService().call(“luna://com.webos.service.alarm/set”,
{
“key”: “my_app_unique_alarm”,
“uri”: “luna://com.omni.devices.app.service/alarmCallback”,
“params”: {
“message”: “time is go”,
“task”: “showNotification”
},
//“at”: “12/25/2024 20:00:00”,
“in”: “00:00:10”,
“wakeup”: true,
“keep_existing”: true
}, (response) => {
console.log(“receive:”, response);
console.log(“error:”, response.isError);
console.log(“error info:”, response.errorText);
console.log(“payload:”, response.payload);

});
console.log(“setAlarm end:”);
};

ServiceContext.getService().register(“alarmCallback”, function(message) {
console.log(“alarmCallback:”, message.payload);

message.respond({
returnValue: true,
message: “success”
});
});

We do not guarantee the compatibility of webOS TV apps with webOS OSE resources. For webOS TV apps, please use webOS TV resources in this website only. Thank you.

My app needs to implement an alarm-like function. What APIs on WebOS TV support this?

We are not sure exactly what function you want to implement, but sending notifications is only available in system apps, not 3rd party apps. For more information, please refer to Notifications. Thank you.

In fact, it is not necessary to have a notification function, but an alarm clock function. Is there an API to implement the alarm clock function?

Currently, no alarm-related API is provided. (You can find all available webOS TV APIs here.) However, webOS TV supports standard web APIs and JavaScript events. So please find more information on Google. Thank you.