access element


<access uri="string" subdomains=["true" | "false"] />


The <access> element specifies that a BlackBerry WebWorks app can access external network resources. By default, if you do not specify an <access> element, an app has access to all local resources. Local resources include any resources in the app archive file. If you specify more than one <access> element, the most specific definition is used. For example, if you use and, the <access> element that uses the first definition (and any features defined under it) is ignored.

If your app makes calls to APIs on an external server, the external server must be declared in the access list. To specify the APIs to access, use the <feature> element.

As a best practice, you should protect your communication channel by using HTTPS when you expose sensitive APIs to the domain. For information about best practices on securing your app, see Accessing external resources.

Parent elements


Child elements

Can contain <feature> elements.


Zero or more


You can use the following attributes in the <access> element:

Attribute Description

The uri attribute defines the web address for the access request.

You can specify a wildcard (*) for the uri to whitelist any domain, but only for domains that do not access app APIs and that do not access content through XMLHttpRequest. If the domain requires access to APIs or accesses data through XMLHttpRequest, you must explicitly specify the domain in the uri. For more information, see Accessing external resources.

The uri attribute is optional.


The subdomains attribute is a Boolean value that specifies whether the host component in the access request applies to subdomains of the domain that is specified in the URI attribute.

This attribute is optional.

By default, if you do not specify the value of the subdomains attribute, the value is set to false and no access to subdomains is requested.

Example: Allowing access to external resources and APIs

<access uri="" subdomains="true">
  <feature id="" version="" required="true"/>
  <feature id="blackberry.invoke" version="" required="true"/>

Last modified: 2014-03-10

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus