// On iOS 7.x or earlier, a selected person is returned with this method. private void HandleSelectPerson(object sender, ABPeoplePickerSelectPersonEventArgs e) { var peoplePicker = (ABPeoplePickerNavigationController)sender; ResultLabel.Text = PersonFormatter.GetPickedName(e.Person); peoplePicker.DismissViewController(true, null); e.Continue = false; }
// iOS7 and below void HandlePerformAction(object sender, ABPeoplePickerPerformActionEventArgs e) { var peoplePicker = (ABPeoplePickerNavigationController)sender; ResultLabel.Text = PersonFormatter.GetPickedEmail(e.Person, e.Identifier); peoplePicker.DismissViewController(true, null); e.Continue = false; }
// iOS7 and below void HandleSelectPerson(object sender, ABPeoplePickerSelectPersonEventArgs e) { var peoplePicker = (ABPeoplePickerNavigationController)sender; e.Continue = false; using (ABMultiValue <string> emails = e.Person.GetEmails()) e.Continue = emails.Count == 1; if (!e.Continue) { ResultLabel.Text = PersonFormatter.GetPickedEmail(e.Person); peoplePicker.DismissViewController(true, null); } }
// On iOS 8.0, a selected person is returned with this method. void HandleSelectPerson2(object sender, ABPeoplePickerSelectPerson2EventArgs e) { ResultLabel.Text = PersonFormatter.GetPickedName(e.Person); }
// iOS8+ void HandlePerformAction2(object sender, ABPeoplePickerPerformAction2EventArgs e) { ResultLabel.Text = PersonFormatter.GetPickedEmail(e.Person, e.Identifier); }