Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Contacts plugin not always showing contacts

$
0
0

@Thread7 wrote:

I have the contacts plugin in my app and on one test device (iPhone 5, iOS 9.02) the contact list does not show. And when I do a search, nothing appears. I get no error messages. On some of my other devices like some Android or iOS 8.x devices it does work. This particular problem device has 1200 contacts. Anyone have some suggestions on how to fix? I'll paste the relevant part of my code. Although maybe it is more of a configuration issue?

			$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("Ja"); //All test devices have contacts containing "Ja"

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>