Forum

Cannot change icon in toast notification except privileged app

Hi, I tried to change icon in toast notification, but it was not changed.
I tried luna-send, WebOSServiceBridge API, and LS2Request in Enact, also I set my requiredPermissions to all in appinfo.json, but didn't work at all.

these are my code.

luna-send -n 1 -f -a com.bangul.app.webos luna://com.webos.notification/createToast '{"sourceId":"com.bangul.app.webos","message":"hello world", "iconUrl":"/usr/palm/applications/com.palm.app.settings/icon.png"}'

LS2.send({
        service: 'luna://com.webos.notification',
        method: 'createToast',
        parameters: {
            "sourceId": "com.bangul.app.webos",
            "message": `${text.title}: ${text[type]}`,
            "persistent": true,
            "iconUrl": "/media/developer/apps/usr/palm/applications/com.bangul.app.webos/icon.png" 
        },
        onComplete: (res) => {
            console.log({ createToast: res })
        },
    })

appInfo.json

{
  "id": "com.bangul.app.webos",
...
 "requiredPermissions": [
    "all","notifications","devices","media"
  ]
}

This is the result of ls-monitor when using luna-send.

2408.792 TX  call       4               com.webos.lunasend-1058 (QVeQDfjE)      com.webos.notification (nO0VDDG6)
com.banugl.app.webos            //createToast   «{"sourceId":"com.banugl.app.webos","message":"hello world","iconUrl":"/media/developer/apps/usr/palm/applications/com.bangul.app.webos/icon.png"}»
2408.792 RX call        4               com.webos.notification (nO0VDDG6)       com.webos.lunasend-1058 (QVeQDfjE)
com.banugl.app.webos            //createToast   «{"sourceId":"com.banugl.app.webos","message":"hello world","iconUrl":"/media/developer/apps/usr/palm/applications/com.bangul.app.webos/icon.png"}»
2408.792 TX  return     36              com.webos.notification (nO0VDDG6)               com.webos.surfacemanager (4U7ietXj)                                 «{"returnValue":true,"message":"hello world","iconPath":"/usr/palm/notificationmgr/images/toast-notification-icon.png","type":"standard","title":"","isCradleReq":false,"sourceId":"com.banugl.app.webos","timesource":"ntp","timestamp":"1598538666539","onlyToast":true,"isSysReq":false,"schedule":{"expire":1601130666},"iconUrl":"file:///usr/palm/notificationmgr/images/toast-notification-icon.png","action":{}}»
2408.792 TX  return     4               com.webos.notification (nO0VDDG6)               com.webos.lunasend-1058 (QVeQDfjE)                                  «{"toastId":"com.banugl.app.webos-1598538666539","returnValue":true}»
2408.792 RX return      36              com.webos.surfacemanager (4U7ietXj)             com.webos.notification (nO0VDDG6)                                   «{"returnValue":true,"message":"hello world","iconPath":"/usr/palm/notificationmgr/images/toast-notification-icon.png","type":"standard","title":"","isCradleReq":false,"sourceId":"com.banugl.app.webos","timesource":"ntp","timestamp":"1598538666539","onlyToast":true,"isSysReq":false,"schedule":{"expire":1601130666},"iconUrl":"file:///usr/palm/notificationmgr/images/toast-notification-icon.png","action":{}}»
2408.792 RX return      4               com.webos.lunasend-1058 (QVeQDfjE)              com.webos.notification (nO0VDDG6)                                   «{"toastId":"com.banugl.app.webos-1598538666539","returnValue":true}»
2408.793 TX  call       6               com.webos.lunasend-1058 (QVeQDfjE)              com.webos.notification (nO0VDDG6)
/com/palm/luna/private/cancel   «{"token":4}»
2408.793 RX call        6               com.webos.notification (nO0VDDG6)               com.webos.lunasend-1058 (QVeQDfjE)
/com/palm/luna/private/cancel   «{"token":4}»

I found that if using app whose name is started com.webos.~ or com.palm.`~,
it did work.
I think it's the problem in below codes

Could you tell me if there's any other way to change Icon in toast notification?

I asked the dev team and they said you are right, it only works on the privileged app. If I hear the updated news about that, I will share it with you.

Hi @jikjoo,

There is no other way to change the icon in toast notification unless you change the OSE source code.
The reason why we prohibit it is:
If it is allowed, there is a possibility to imitate famous app's notification (such as YouTube, Netflix.) And it can be considered as a potential security threat.

Thanks,