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 Developer
bbinto
Posts: 6
Registered: ‎02-04-2010
My Device: Several Models
My Carrier: Bell Canada
Accepted Solution

Does the blackberry.invoke in external JS file work?

Hi,

 

Can the blackberry.invoke object only be called from within the BB widget files, i.e. within the js file stored in your Eclipse BB Widget project or from outside/external file, stored on http?

 

Thanks,

Barbara

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Does the blackberry.invoke in external JS file work?

If you whitelist an outside origin in the <access> elements of the config.xml file (such as your own website) and then place the <feature> element for the invoke API in that <access> element, you can serve up pages from the whitelisted domain to execute this feature.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
bbinto
Posts: 6
Registered: ‎02-04-2010
My Device: Several Models
My Carrier: Bell Canada

Re: Does the blackberry.invoke in external JS file work?

Thanks Tim.

 

Great, however, I got an error:

 

Invalid config.xml - no <feature> tags are allowed for this <access> element

 

 

 

<access subdomains="false" uri="*">  

 <feature id="blackberry.invoke" required="true" version="1.0.0.0"/>

</access>

 

 

Thanks

B

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Does the blackberry.invoke in external JS file work?

You cannot add APIs to wildcards because it opens up security holes. You will need to add APIs to a defined origin
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
bbinto
Posts: 6
Registered: ‎02-04-2010
My Device: Several Models
My Carrier: Bell Canada

Re: Does the blackberry.invoke in external JS file work?

Thanks. Worked great.

 

B

 

 

Please use plain text.