Open jikjoo opened 4 years ago
luna-send -n 1 -f -a com.webos.test.app luna://com.webos.notification/createToast '{"sourceId":"com.webos.test.app","message":"hello world", "iconUrl":"/usr/palm/applications/com.palm.app.settings/icon.png"}'
를 해봤는데, 아이콘이 바뀌었음.
이번에도 requiredPermissions 문제인거 같음.
ls-monitor
로 확인해봤는데
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}»
어떤 권한이 필요한지 몰라서, 일단 "requiredPermissions" : ["all"]
로 바꿈
어떤 권한이 필요한지 몰라서, 일단
"requiredPermissions" : ["all"]
로 바꿈
그래도 안되네
com.webos 혹은 com.palm으로 시작되어야 아이콘이 바뀜.
luna-send -n 1 -f -a com.webos.abcdef luna://com.webos.notification/createToast '{"sourceId":"com.webos.app.abcdef","message":"hello world", "iconUrl":"/usr/palm/applications/com.webos.app.test.youtube/icon.png"}'
https://github.com/webosose/notificationmgr/blob/master/src/NotificationService.cpp
// 위에서 언급한 com.webos / com.palm / com.lge 으로 시작하는것만 iconUrl 작동함.
if(Settings::instance()->isPrivilegedSource(caller))
{
iconPath = request["iconUrl"].asString();
}
else
{
iconPath = AppList::instance()->getIcon(sourceId);
//getIcon은 sourceId가 palm://com.webos.applicationManager/listApps에 존재하는지 보고 folderPath+"/icon.png"
}
if(iconPath.length() != 0 && Utils::verifyFileExist(iconPath.c_str()))
{
postCreateToast.put("iconUrl", "file://"+iconPath);
postCreateToast.put("iconPath", iconPath);
}
else
{ //iconPath가 존재하지 않으면, defaultIcon으로 감
postCreateToast.put("iconUrl", "file://"+ Settings::instance()->getDefaultIcon("toast"));
postCreateToast.put("iconPath", Settings::instance()->getDefaultIcon("toast"));
}
iconUrl : 'file:///media/developer/apps/usr/palm/applications/com.bangul.app.webos/icon.png'
iconUrl : '/media/developer/apps/usr/palm/applications/com.bangul.app.webos/icon.png'
iconUrl : icon.png
시도해봤는데, 모두 안됐음.