我已經安裝了cordova 3.0.0並創建了一個helloworld項目,並安裝了cordova-plugin-contacts。 科爾多瓦建立helloworld com.example.helloworld的 「HelloWorld」 CD的Helloworld 科爾多瓦平臺添加IOS 科爾多瓦建設 科爾多瓦插件添加https://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git'undefined'不是函數(評估'navigator.contacts.chooseContact(onSuccess,選項)')
,並試圖調用navigator.contacts.chooseContact
function contactChooser(){
var options = new ContactFindOptions();
options.fields = ["displayName", "name", "emails", "phoneNumbers"];
navigator.contacts.chooseContact(onSuccess, options);
}
,但得到的Safari瀏覽器這個錯誤網絡檢查員。
我不確定Cordova是如何工作的,但navigator.contacts的控制檯日誌是什麼?這應該顯示chooseContact是暴露/可用。 – techiev2
作爲標題說它是未定義的。 – enRaiser
如果我包含plugins/org.apache.cordova.core.contacts/www/ios/contacts.js,那麼我可以擺脫這個問題。但是接下來會出現一個新問題,它說contacts.js的第57行的其他函數未定義,並且說create是未定義的。var fullContact = require('./ contacts')。create(result); – enRaiser