언어 설정

Menu
Sites
Language
Notification ressources

Hello,

I am testing a notification example, within my code, I add a sound + an image to y notification:

var notificationDict = {
                      content : "This is a simple notification.",
	                  iconPath : "./images/icon5.png",
	                  soundPath : "/opt/usr/media/music.mp3", 
	                  vibration : true, 
	                  appControl : appControl};

 

The problem is that I must:

1- insert the sound in the local folders of the emulator manually (as shown in the path), and I would like to know how to do it with the code.

2- Same thing with the iconPath, I created an "images" folder into my project, in which I insert "icon5.png" and I have specified my image path in the iconPath attribute, but the icon didn't show up!

How to solve this issue?

Thank you

Responses

2 댓글
Marco Buettner

Try 

iconPath: "/opt/usr/apps/{packageId}/images/icon5.png",

 

AVSukhov

Hello,

If to be more correct:

You can use following path:

"opt/usr/apps/{packageId}/res/wgt/img/icon.png"

or if use virtual root:

"wgt-package/img/icon.png"

where "img" - directory under your project.

According documenatation:

The path in the iconPath and soundPath parameters means a relative file location defined in the Filesystem API. The path is not an absolute file location, but instead uses a virtual root location (such as images in images/image1.jpg).