【问题标题】:Cordova 3.4 contact plugin not working?Cordova 3.4 联系人插件不起作用?
【发布时间】:2014-05-17 00:18:14
【问题描述】:

是否有其他人无法让联系人插件在 cordova 3.4 中工作?

无论我做什么,我都会收到此错误:ReferenceError: ContactFindOptions is not defined

所有其他插件都工作正常。我只使用 IOS。

当设备准备就绪时,我只是使用文档中的基本示例:

var options      = new ContactFindOptions();
        options.filter   = "Milo";
        options.multiple = true;
        var fields       = ["displayName", "name"];
        navigator.contacts.find(fields, onSuccess, onError, options);

【问题讨论】:

  • 您正确包含插件并更新了 config.xml 文件?
  • 是的。当通过命令行安装时,Cordova 会自动在配置中添加引用。如果插件未在配置中初始化,它也会在 xcode 控制台中产生引用错误。
  • 它看起来类似于例如电池插件,效果很好。

标签: cordova contacts


【解决方案1】:

参数排序不正确。检查:

navigator.contacts.find(onSuccess, onError, fields, options);

【讨论】:

    【解决方案2】:
    Please see my below instructions:
    
    First, You should check (Contact) installed plugin via terminal properly
    
    > $ cordova plugin add org.apache.cordova.contacts
    
    Second, You should check your entry is mention in config.xml properly which is looks like below:- 
    
    > <feature name="Contacts">
    >         <param name="ios-package" value="CDVContacts" />
    >     </feature>
    
    Third, please also check you mention cordova.js in html 
    
    Thanks,
    

    【讨论】:

      猜你喜欢
      • 2016-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多