基于这个文档。
我是通过执行以下步骤在BlackBerry10上添加本机功能:
这是我在我的config.xml MFP项目上的Blackberry10示例内容:
<?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>
这是我在Android项目上的config.xml的示例内容:
<?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>
我的问题是:如何在config.xml中为BlackBerry10配置MobileFirst,以便触发本机函数?
发布于 2016-01-10 21:09:27
对此没有内置的支持,但是完成需求的步骤应该类似于官方的Cordova指南中提到的步骤,还有几个步骤:https://cordova.apache.org/docs/en/5.0.0/guide/platforms/blackberry10/plugin.html,
- Add unique id (should be same as feature value of plugin.xml) e.g. first line of js should be like:
cordova.define("com.blackberry.test.hello.Hello",函数(要求,导出,模块){.你的js}的内容);
https://stackoverflow.com/questions/34127240
复制相似问题