我的应用程序调用时出现此错误:
navigator.contacts.find(fields, onSuccess, onError, options);
onError回调--->无法找到类联系人。
我认为这可能是插件配置的问题。在我的plugins.xml中,我有这一行:
<plugin name="Contacts" value="org.apache.cordova.pim.Contact"/>
和config.xml:
<feature id="blackberry.identity" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
我正在使用Phonegap 2.7.0构建,我已经关注了api guide。 并部署到BB10模拟器。
我不知道“联系人”的配置问题是什么,任何想法?
编辑:这是我对BB10的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!--
Widget Configuration Reference:
http://docs.blackberry.com/en/developers/deliverables/15274/
-->
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0"
id="com.xxxxx.xxxx">
<name>xxxx</name>
<author href="http://www.xxxxx.es" email="info@xxxxx.es">
xxxxx
</author>
<description>
xxxxx description.
</description>
<license href="http://opensource.org/licenses/alphabetical">
</license>
<!-- Cordova API -->
<feature id="blackberry.system" required="true" version="1.0.0.0" />
<feature id="org.apache.cordova" required="true" version="1.0.0" />
<feature id="blackberry.find" required="true" version="1.0.0.0" />
<feature id="blackberry.identity" required="true" version="1.0.0.0" />
<feature id="blackberry.identity.phone" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
<feature id="blackberry.io.file" required="true" version="1.0.0.0" />
<feature id="blackberry.utils" required="true" version="1.0.0.0" />
<feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
<feature id="blackberry.app" required="true" version="1.0.0.0" />
<feature id="blackberry.app.event" required="true" version="1.0.0.0" />
<feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
<feature id="blackberry.media.camera" />
<feature id="blackberry.ui.dialog" />
<feature id="blackberry.connection" />
<feature id="blackberry.bbm.platform" />
<feature id="blackberry.invoke.card" />
<feature id="blackberry.pim.contacts" />
<feature id="blackberry.ui.contextmenu" />
<feature id="blackberry.io.filetransfer" />
<feature id="blackberry.io" />
<feature id="blackberry.invoke" />
<feature id="blackberry.invoked" />
<feature id="blackberry.push" />
<feature id="blackberry.media.microphone" required="true" version="1.0.0.0"/>
<!-- Cordova API -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
<!-- Expose access to all URIs, including the file and http protocols -->
<access uri="*" subdomains="true" />
<access uri="http://phonegap.com" subdomains="true"/>
<access uri="http://debug.build.phonegap.com" subdomains="true"/>
<access uri="http://xxxxx.com" subdomains="true"/>
<!--
<icon rim:hover="false" src="res/icon/blackberry/icon-80.png" />
<icon rim:hover="true" src="res/icon/blackberry/icon-80.png" />
-->
<icon rim:hover="false" src="res/icon/blackberry/windows_phone_62x62.png" />
<icon rim:hover="true" src="res/icon/blackberry/windows_phone_62x62.png" />
<rim:loadingScreen backgroundColor="#CFCFCF"
foregroundImage="res/screen/blackberry/screen-225.png"
onFirstLaunch="true">
<rim:transitionEffect type="fadeOut" />
</rim:loadingScreen>
<content src="index.html" />
<rim:permissions>
<rim:permit>use_camera</rim:permit>
<rim:permit>read_device_identifying_information</rim:permit>
<rim:permit>access_shared</rim:permit>
<rim:permit>read_geolocation</rim:permit>
<rim:permit>record_audio</rim:permit>
<rim:permit>access_pimdomain_contacts</rim:permit>
</rim:permissions>
</widget>
答案 0 :(得分:0)
您使用的功能ID适用于旧版本的BlackBerry OS。请使用<feature id="blackberry.pim.contacts" />