Closed bucketclan closed 6 years ago
Are you on Android or iOS? Are the FirstName & LastName properties filled when you add the contact ?
I am on Android. No, nothing is pre-filled. I wouldn't want it to be pre-filled.
when you call : await ContactsService.addContact(newContact); the newContact does not have a LastName or FirstName ?
Yup. await ContactsService.addContact(new Contact());
That is the problem, you cannot add an empty contact. In your android contacts app, if you add a new contact, do not enter any information and press "Save", the contact is not added because it does not have any information. I should add it to the readme.
Tried await ContactsService.addContact(new Contact(givenName: "h", familyName: "b"));
too. Doesn't it open the add contact page of the phone's contact app?
this is working for me
await ContactsService.addContact(new Contact(givenName: "a", familyName: "b"));
Can you make sure contact permissions are enabled ?
If so, tell me what is your device & android version, i'll try to reproduce the issue
The contact permissions are enabled. Android Version: 5.1 Model Number: Moto G
Also can you please let me know, whether the add contacts screen is opened or does it directly add to the contacts?
It adds the contact directly to your contact list So if you open your contacts app you should be able to see it.
Just tried on a 5.1.1 tablet it's working fine. Can you try to run the sample, add a contact, fill in the first & last name in the form, save, open the contacts app and see if it's in there ?
Tried the sample app, add contacts works well. I really wanted it to open the add contacts screen of the contacts. Thanks for the help and for the package.
Contact contact = Contact(); contact.givenName = 'firstname'; contact.displayName = 'fullname'; contact.phones = [Item(label: "mobile", value: '2222222222')]; contact.company = "company"; ContactsService.addContact(contact);
I tried to add a contact, but calling the provided function does nothing i.e nothing happens. I am sure that the function inside the package is being called upto the dart code which defines the same.
I making using of this package to get contacts which works perfectly.