基於此documentation。在IBM MobileFirst 6.3中添加原生功能BlackBerry10
我做這個的BlackBerry10添加原生功能步驟:
創建本機類
創建插件的javascript
配置的plugin.xml:
這是我的config.xml對我Blackberry10 MFP項目樣本內容:
<?xml version='1.0' encoding='utf-8'?>
<widget id="Mordor" version="1.0.1.2" xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" rim:backButton="exit">
<name>Mordor</name>
<author email="application author's e-mail">application's author</author>
<description>
Mordor
</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://blablabla.com" />
<!-- 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>
這是我的config.xml文件的樣本內容我的Android MFP項目:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
id = "Mordor"
version = "1.0.0.0">
<name>Mordor</name>
<description>
Mordor
</description>
<author href="http://mycompany.com" email="application author's e-mail">
application's author
</author>
<access origin="*"/>
<preference name="loglevel" value="DEBUG" />
<!--
<preference name="splashscreen" value="resourceName" />
<preference name="backgroundColor" value="0xFFF" />
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
<!-- This is required for native Android hooks -->
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<feature name="RootDetectionPlugin">
<param name="android-package" value="com.Mordor.plugin.RootDetectionPlugin" />
</feature>
</widget>
爲Android項目,我只是簡單地添加以下這個配置我的config.xml:
<feature name="RootDetectionPlugin">
<param name="android-package" value="com.Mordor.plugin.RootDetectionPlugin" />
</feature>
我的問題是: 如何配置BlackBerry10 config.xml文件中MobileFirst,這樣我就可以觸發本機功能?