Blackberry config.xml 在 Worklight 构建方法上有所不同

Blackberry config.xml is different in Worklight build methodologies

我正在使用两种不同的方式在 Worklight 中构建我们的 BB10 环境。

1- 通过 Eclipse IDE:

搭建环境后生成的native文件夹中的config.xml包含了我们项目中需要的所有功能。

<?xml version='1.0' encoding='utf-8'?>
<widget id="MobileBanking" version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" rim:backButton="exit">
    <name>Mobile Bank</name>
    <author email="support@company.com">company</author>
    <description>
       Mobile Bank
    </description>
    <license href="http://opensource.org/licenses/alphabetical">
    </license>
    <access subdomains="true" uri="file:///store/home" />
    <access subdomains="true" uri="file:///SDCard" />

<!-- start_worklight_host_server do not change this line-->


<access subdomains="true" uri="https://mobile-qa.company.ca" />
  <!-- end_worklight_host_server do not change this line-->

<access subdomains="true" uri="tel://*"/>
<access subdomains="true" uri="http://google.com"/>
<access subdomains="true" uri="http://maps.googleapis.com"/>
<access subdomains="true" uri="http://googleapis.com"/>
<access subdomains="true" uri="http://maps.gstatic.com"/>
<access subdomains="true" uri="http://fonts.gstatic.com"/>
<access subdomains="true" uri="http://csi.gstatic.com"/>
<access subdomains="true" uri="https://www.company.com/*" />



<!-- <access subdomains="true" uri="*" /> -->

<icon src="icon.png" />
<rim:splash src="splash-1024x600.png" />
<rim:splash src="splash-600x1024.png" />
<rim:splash src="splash-1280x768.png" />
<rim:splash src="splash-768x1280.png" />
<content src="webresources/skinLoader.html" />
<rim:permissions>
    <rim:permit>read_device_identifying_information</rim:permit>
    <rim:permit>access_shared</rim:permit>
    <rim:permit>read_geolocation</rim:permit>
    <rim:permit>access_pimdomain_contacts</rim:permit>
    <rim:permit>access_pimdomain_messages</rim:permit>
    <rim:permit>access_location_services</rim:permit>
</rim:permissions>

<preference name="HideKeyboardFormAccessoryBar" value="true"/>
<preference name="Orientation" value="portrait"/>
<preference name="ChildBrowser" value="disable"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="WebSecurity" value="enabled" />



 <feature id="blackberry.invoke" name="blackberry.invoke" value="blackberry.invoke" />


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

<feature id="com.blackberry.utils" name="com.blackberry.utils" />
<feature id="com.blackberry.pim.lib" name="com.blackberry.pim.lib" />
<feature id="Battery" name="Battery" value="Battery" />
<feature id="Camera" name="Camera" value="Camera" />
<feature id="Contacts" name="Contacts" value="Contacts" />
<feature id="Device" name="Device" value="Device" />
<feature id="Accelerometer" name="Accelerometer" value="Accelerometer" />
<feature id="Compass" name="Compass" value="Compass" />
<feature id="Notification" name="Notification" value="Notification" />
<feature id="org.apache.cordova.file" name="File" value="File" />
<feature id="FileTransfer" name="FileTransfer" value="FileTransfer" />
<feature id="Geolocation" name="Geolocation" value="Geolocation" />
<feature id="Media" name="Media" value="Media" />
<feature id="Capture" name="media-capture" value="Capture" />
<feature id="NetworkStatus" name="NetworkStatus" value="NetworkStatus" />
<feature id="SplashScreen" name="SplashScreen" value="SplashScreen" />
<feature id="Vibration" name="Vibration" value="Vibration" />
 </widget>

2- 当我使用 Ant Worklight Builder 时,为 BB10 生成的本机文件夹包含以下 config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="MobileBank" version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" rim:backButton="exit">
    <name>MobileBank</name>
    <author email="support@company.com">company</author>
    <description>
       MobileBanking
    </description>
    <license href="http://opensource.org/licenses/alphabetical">
    </license>
    <access subdomains="true" origin="file:///store/home" />
    <access subdomains="true" origin="file:///SDCard" />

    <!-- start_worklight_host_server do not change this line-->
  <access subdomains="true" origin="https://mobile-qa.company.ca" />
  <!-- end_worklight_host_server do not change this line-->

    <access subdomains="true" origin="*" />
    <icon src="icon.png" />
    <rim:splash src="splash-1024x600.png" />
    <rim:splash src="splash-600x1024.png" />
    <rim:splash src="splash-1280x768.png" />
    <rim:splash src="splash-768x1280.png" />
    <content src="webresources/skinLoader.html" />
    <rim:permissions>
        <rim:permit>read_device_identifying_information</rim:permit>
        <rim:permit>access_shared</rim:permit>
        <rim:permit>read_geolocation</rim:permit>
        <rim:permit>access_pimdomain_contacts</rim:permit>
    </rim:permissions>
 </widget>

使用 Ant 构建器时所有功能标签都消失了。

Worklight Ant 任务版本 6.2.0.01.20150329-1923

WebWorks SDK 版本 2.2.0.15。

我尝试了 Windows 和 Mac。得到相同的结果。 谢谢。

查看此博客 post:https://developer.ibm.com/mobilefirstplatform/2015/03/05/ootb-support-blackberry-webworks-2-2/

我已经两次使用 BlackBerry 10 环境创建应用程序:使用 WebWorks 1.0 SDK 和 WebWorks 2.2 SDK。 config.xml 中的差异是由于使用的 SDK。

  • 如果 WEBWORKS_HOME 的环境变量指向 WebWorks 1.0,Worklight 构建器将创建第一个 config.xml。
  • 如果 WEBWORKS_HOME 的环境变量指向 WebWorks 2.2,Worklight 构建器将创建第二个 config.xml。

这意味着您的 Studio 和 Ant .jar 文件不是同一版本的 Worklight。
从 IBM Fix Central 获取最新的 iFix;要获取 Ant .jar,我相信您需要解压缩服务器安装才能获取它。