Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 6
Registered: ‎12-23-2012
My Device: Playbook 2.0
My Carrier: MegaFon RUS

blackberry.io.dir is undefined

Hello. I have a problem with blackberry.io.dir in my WebWorks app. The code above always get "Uncaught TypeError: Cannot read property 'appDirs' of undefined" in Ripple:

 

var a = blackberry.io.dir.appDirs.shared.downloads.path;

 There is my config.xml:

<widget xmlns:rim="http://www.blackberry.com/ns/widgets" id="bbUISamples" version="0.9.1.25" rim:header="RIM-Widget:rim/widget" xmlns="http://www.w3.org/ns/widgets">
  <name>bbUI Samples</name>
  <description>An example of how to use different BlackBerry UI layouts and controls</description>
  <author href="https://github.com/tneil">Tim Neil</author>
  <icon src="images\icon.png" />
  <icon src="images\icon.png" rim:hover="true" />
  <rim:splash src="images\bb10-splash-landscape.png" />
  <rim:splash src="images\bb10-splash-portrait.png" />
  <rim:permit>access_shared</rim:permit> 
  <content src="index.htm" />
  <feature id="blackberry.ui.menu" />
  <feature id="blackberry.ui.dialog"/>
  <feature id="blackberry.utils" />
  <feature id="blackberry.io" required="true"/>
  <feature id="blackberry.io.file" />
  <feature id="blackberry.system.event" />
  <feature id="blackberry.system" required="true" version="1.0.0.0"/>
  <feature id="blackberry.app" />
  <feature id="blackberry.app.event"/>
</widget>

 I have no idea what wrong with my code and I will realy happy if somebody would explain me where i have got a error

Retired
Posts: 71
Registered: ‎09-19-2012
My Device: No sleep til BlackBerry 10
My Carrier: Bell

Re: blackberry.io.dir is undefined

Are you building a BlackBerry 10 app? I see that you had a splashscreen image for BB10. However, blackberry.io doesn't have a property called "dir" for BlackBerry 10 but it might for older OS versions. You can always double check API support for each OS at http://developer.blackberry.com/html5/apis

 

Hope that helps!

------------------------------
@grahamzibar
-_- zZZ
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: blackberry.io.dir is undefined

Ripple is really bad at this - I think this is mostly due to the settings in Chrome (it's scared a lot of bad things happenning)

 

There is a setting in Ripple to overcome this but I prefer the following

 

chrome --allow-file-access-from-files

 

Basically all you need to do is add the switch to any Chrome start-up icon - so copy it and rename it as VeryDangerous or something (this should NOT be used for web browsing)

 

This is something to take caution with - if you accidentally go to a site with this permission, expect nasty results as a possible result (use it in a VM is safer)

 

 

 

 

 

 




Click the like button if you find my posts useful!