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
Highlighted
New Developer
Posts: 58
Registered: ‎11-27-2008
My Device: Not Specified
Accepted Solution

currently only JSON request like flickr run all other ajaxs blocked

C:\Users\User\Pictures\screenshots\DEVhow in real emulator (900MB) I enable connection currently only JSON request like flickr run all other ajaxs blocked, well?

 

not-allowed-access-to-url-bb-dev.jpg

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: currently only JSON request like flickr run all other ajaxs blocked

Have you white-listed the domain in your config.xml?

For example, if the full URL was:
http://subdomain.domain.com/announcements.php

You would need to include the following in your config.xml:
<access uri="http://domain.com" subdomains="true" />

With the new WebWorks 2.0 SDK, you would want to use origin instead of uri.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Developer
Posts: 58
Registered: ‎11-27-2008
My Device: Not Specified

Re: currently only JSON request like flickr run all other ajaxs blocked

<access uri="*" />

 this icludes all or? i kept default that is on new proj for this statement...

 

another Q:

feature tag in config.xml mention permissins?

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: currently only JSON request like flickr run all other ajaxs blocked

The * allows you to access / navigate to URLs, but does not include AJAX requests. You'll need to explicitly white-list URLs you want to make an AJAX request to.'

 

 

another Q:
feature tag in config.xml mention permissins?

I'm not sure I follow. Can you post an example?

 

Features white-list API access and may sometimes require device permissions. Some APIs will have corresponding permissions, but others don't need anything extra.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Developer
Posts: 58
Registered: ‎11-27-2008
My Device: Not Specified

Re: currently only JSON request like flickr run all other ajaxs blocked

    <feature name="http://api.phonegap.com/1.0/device" />
	<feature name="http://api.phonegap.com/1.0/geolocation" />
	<feature name="http://api.phonegap.com/1.0/network" />

 these needed in xml config for webworks compile and build and deploy? are you sure i must use for each ajax call domain permision with <access> ... or is this since not included

<feature name="http://api.phonegap.com/1.0/network" />

 

???

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: currently only JSON request like flickr run all other ajaxs blocked

Those features are specific to PhoneGap, if your application is making use of those APIs, you will need them present.

 

As for the <access> element, this is discussed in the documentation.

 

The wildcard character (*) cannot be used for data accessed by XMLHttpRequest. To access data using the XMLHttpRequest, you must explicitly specify each domain.

https://developer.blackberry.com/html5/documentation/beta/accessing_external_resources_webworks.html

 

If you are using PhoneGap's Network APIs you would need that feature present. Note that those features are for specific APIs though (custom functions and methods that provide native support for various platforms.) Sending an AJAX request is a standard HTML5 capability that you can do without Cordova/PhoneGap/WebWorks in general, and on the BlackBerry platform, if you have not explicitly white-listed the URL, the call will fail.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 164
Registered: ‎11-27-2012
My Device: Z10 LE,Dev Alpha C
My Carrier: China Mobile

Re: currently only JSON request like flickr run all other ajaxs blocked

if you want to avoid the cross-domain scripting limit

use my curl plugin.

It's one of the community API now.

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10-Cordova/Curl

 

var data=community.curl.get('your json url') ; // the plugin is set to be timeouted after 3 seconds.

var jsondata=JSON.parse(data);

 

add your try-catch block.

BlackBerry Cascades / WebWorks developer, Vendor name: anpho
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: currently only JSON request like flickr run all other ajaxs blocked

Hi lse123, were you able to overcome this issue? If not, please let us know.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Developer
Posts: 58
Registered: ‎11-27-2008
My Device: Not Specified

Re: currently only JSON request like flickr run all other ajaxs blocked

yes done...

youtube videos urls and google maps urls to a particular video or map, needed also permission? open always inside app context?

 

BlackBerry Development Advisor
Posts: 758
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: currently only JSON request like flickr run all other ajaxs blocked

If all else fails, or you happen to be trying to access several different domains, you could always just disable web security for your project as well via the config.xml file. Smiley Happy

 

For WebWorks 1.x

 

<feature id="blackberry.app" >
    <param name="websecurity" value="disable" />
</feature>

 

For WebWorks 2.0

 

<feature id="blackberry.app" >
    <param name="websecurity" value="disable" />
</feature>