<platform>

Syntax:

<platform name="blackberry10">
    <rim:permissions>
        <rim:permit> ...</rim:permit>
    </rim:permissions>
</platform>

Description:

The <platform> element contains platform-specific application information. For example, using the <platform> element, you can specify a platform-specific splash screen image for your cross-platform app, and specify app permissions or preferences that are specific to the BlackBerry 10 OS. Invocation settings, which are also specific to BlackBerry 10, must also be defined within a <platform> element.

If you are developing a cross-platform app, you should have one <platform> element for each platform you are targeting with your app.

Occurrences:

Zero or more.

Parent elements:

<widget>

Child elements:

Name Occurrences

<icon>

zero or more

<preference>

zero or more

<rim:invoke-target>

zero or more

<rim:permissions>

zero or more

<rim:splash>

one or none

Content:

None.

Attributes:

You can define the following attributes for this element:

Attribute Description
name

Required. Specifies the platform name. The value for name is case insensitive.

In a BlackBerry WebWorks app, you should have an instance of <platform> with a name value of blackberry10.

Other supported values include:
  • ios
  • android
  • firefoxos
  • tizen
  • wp8
  • windows8

Examples:

Registering bound and unbound invocations of a BlackBerry app

<widget xmlns:rim="http://www.blackberry.com/ns/widgets">
.
.
.
    <platform name="blackberry10">
        <rim:invoke-target id="com.domain.subdomain.appname.app">
            <type>APPLICATION</type>
            <filter>
                <action>bb.action.OPEN</action>
                <action>bb.action.SET</action>
                <mime-type>text/*</mime-type>
                <property var="exts" value="bmp,css,html,js" />
                <property var="uris" value="data://local,file://" />
            </filter>
        </rim:invoke-target>
    </platform>
</widget>

Specifying BlackBerry specific permissions

<widget xmlns:rim="http://www.blackberry.com/ns/widgets">
.
.
.
    <platform name="blackberry10">
        <rim:permissions>
            <rim:permit>access_shared</rim:permit>
            <rim:permit>read_geolocation</rim:permit>
            <rim:permit>use_camera</rim:permit>
        </rim:permissions>
    </platform>
</widget>

Last modified: 2015-04-16



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

comments powered by Disqus