我在我的应用程序中使用了联系人插件,在一个测试设备上(iPhone 5,iOS 9.02),联系人列表不显示。当我进行搜索时,什么也没有出现。我没有收到任何错误消息。在一些其他设备上,如一些Android或iOS 8.x设备上,它是可以工作的。这个特定的问题设备有1200个联系人。有人有解决方法吗?我会粘贴代码的相关部分,虽然也许更多的是配置问题?
$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");