Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library fetches phone contacts only #53

Open
hasnabbas opened this issue Oct 2, 2018 · 0 comments
Open

Library fetches phone contacts only #53

hasnabbas opened this issue Oct 2, 2018 · 0 comments

Comments

@hasnabbas
Copy link

I am trying to get contact name using phone number but it returns null when the contact is in sim.

This is my code:

          fun getContactName(phone: String): String{
             val query = Contacts.getQuery()
             query.whereEqualTo(Contact.Field.PhoneNumber, phone)
             val contacts = query.find()
             return if (contacts.isNotEmpty())
                 contacts[0].displayName

             else
                 ""
         }
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant