enisn / xamarin.forms.contacts Goto Github PK
View Code? Open in Web Editor NEWRead Contacts Data on iOS and Android
License: MIT License
Read Contacts Data on iOS and Android
License: MIT License
Was working but now the app is crashing... it seems like the call await Plugin.ContactService.CrossContactService.Current.GetContactListAsync() its returning nothing on my mobile phone.
I am using the latest version of this plugin on a Galaxy S8 with Android 8.
My app is on Stores...was working fine. Now, stopped just on Android... I am trying to debug but when I call GetContactListAsync(), seems like the execution is not called... goes fast to the next line and the result is null.
My app works fine on iOS. On the Android emulator it crashes with permissions error.
Error details :
com.android.providers.contacts.ContactsProvider2 from ProcessRecord{f043a77 10438:com.company.application/u0a80} (pid=10438, uid=10080) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
Manifest file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.09" package="com.company.application" android:installLocation="auto" android:versionCode="377">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="Application" android:icon="@drawable/app_icon"></application>
</manifest>
Any ideas? Is it the emulator perhaps - everything else has work 100% on that so far....
When i Test this plugin In Android 6 api level 23 is not working fine when i debugging in Android 4.4 API level 19 it s woking fine. Please let me know what is the problem i am facing?
Can you please check from your side if possible. Thanks.
No more commits and latest version unlisted on nuget... is this project still maintained?
This is how phone numbers appear...
<CNPhoneNumber: 0x10cef0e50: stringValue=+25471234567, initialCountryCode=(null)>
Is there something I'm missing? Is there some formatting needed to get the exact phone number?
On Android it works fine.
Adding support to contact address :
to be the name, email, and address
https://github.com/enisn/Xamarin.Forms.Contacts/blob/master/Plugin/ContactService/Shared/Contact.cs#L39
Is it possible to display contact name in lastname, firstname order?
Hi,
On android devices always first contact created is ignored. If you have 1 contact show no contact, 2 show 1, 3 show 2 and so on.
Maybe this can be the reason on Plugin/ContactService/Platforms/Android/ContactServiceImplementation.cs
"if (cursor.MoveToFirst())" you move to first record, but you do nothing, then you "while (cursor.MoveToNext())" and move to second record and start to put records into a list.
Is there any reason why the Emails and Numbers collections only have the value and not the key as well?
Hello, Your latest version of the 1.0.1 throws a SIGABRT error on iOS. I am using iPhone 6
For instance, on Android that I am testing now, I got the result content://com.android.contacts/contacts/120
How to show this image ?
Hi!
I am trying to enhance some logic in the plugin, but don't quite understand a purpose of ContactService.Android and iOS projects (from DependencyService) folder as long as implementation of those services (seems) located in ContactService\Shared* corresponding files.
Any hint?
Hello,
I've tested the scenario (at least on iOS) where the user refuses the permission for the app to access the address book, and it seems the next time we call GetContactListAsync, it does not ask for it again and only returns an empty list (like for the initial call).
This is problematic.
We cannot determine if the user has accepted the permissions or not versus an empty address book.
Any suggestions?
Thanks
Hi,
I'm using v1.0.5.
I'm not able to filter contacts like you mention in README.
var contacts = await Plugin.ContactService.CrossContactService.Current.GetContactListAsync(x=>x.Emails.Count > 0);
IContactService does not include any parameter for GetContactList methods :
namespace Plugin.ContactService { public interface IContactService { // Gets contacts in main thread !!!NOT RECOMMENDED IList<Contact> GetContactList(); // Gets contact in an awaitable background task Task<IList<Contact>> GetContactListAsync(); } }
Therefore, I'm obliged to get all contacts from phone before display... and this can take a lot of time when user as more than 500 contacts...
What can I do to enable filtering ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.