我的應用程序和一個測試設備(iPhone 5,iOS 9.02)的聯繫人插件沒有顯示聯繫人列表。當我搜索時,什麼也沒有顯示。我沒有收到錯誤消息。在我的其他一些設備上,例如某些Android或iOS 8.x設備,它確實有效。這個特定的問題設備有1200個聯繫人。任何人都有如何解決的建議?我將粘貼我的代碼的相關部分。雖然也許它更像是一個配置問題?Cordova聯繫人插件不總是顯示聯繫人列表
$scope.getAllContacts = function(searchQuery) {
try {
var opts = { //search options
filter: searchQuery, // 'Bob'
multiple: true, // Yes, return any contact that matches criteria
fields: ['displayName', 'name']
};
if (ionic.Platform.isAndroid()) {
opts.hasPhoneNumber = true; //hasPhoneNumber only works for android.
};
$ionicLoading.show();
$cordovaContacts.find(opts).then(function(contactsFound) {
$scope.contacts = contactsFound;
$ionicLoading.hide();
});
} catch (err) {
alert(err.message);
}
};
$scope.getAllContacts("Ak");
嘗試評論'contactsFound'上的代碼,並只是提醒一下,看看它是否通過。如果這是需要花費太多時間來處理的。我遇到了類似的情況,但在Phonegap上,我在多個進程中分發進程以獲得結果。順便說一句,我有5000個聯繫人 –
如果插件不能按預期工作,請在issues.cordova.io上提出問題 – jcesarmobile