Ejemplo n.º 1
0
 public void DidComplete(CNContactViewController viewController, CNContact contact)
 {
     base.NavigationController.PopViewController(true);
     if (contact != null)
     {
         base.NavigationController.ShowAlert($"{contact.GetFormattedName()} was successsfully added.");
     }
 }
Ejemplo n.º 2
0
        public void DidSelectContact(CNContactPickerViewController picker, CNContact contact)
        {
            var name = contact?.GetFormattedName();

            if (!string.IsNullOrEmpty(name))
            {
                this.message = $"{name} was selected.";
            }
        }
Ejemplo n.º 3
0
        private void FetchContact(string name, Action <CNContact[]> completion)
        {
            var result = store.GetUnifiedContacts(CNContact.GetPredicateForContacts(name),
                                                  new ICNKeyDescriptor[] { CNContactViewController.DescriptorForRequiredKeys },
                                                  out NSError error);

            if (error != null)
            {
                Console.WriteLine($"Error: {error.LocalizedDescription}");
            }
            else
            {
                DispatchQueue.MainQueue.DispatchAsync(() => completion(result));
            }
        }