In this recipe, we will discuss how to access and manage the user's stored contacts in the device's address book.
Perform the following steps:
Add a button on the view of the controller.
Enter the following
using
directive in theAddressBookAppViewController.cs
file:using MonoTouch.AddressBook;
Override the
ViewDidLoad
method:public override void ViewDidLoad () { base.ViewDidLoad (); this.btnReadContacts.TouchUpInside += (s, e) => { ABAuthorizationStatus abStatus = ABAddressBook.GetAuthorizationStatus(); NSError error; ABAddressBook addressBook = ABAddressBook.Create(out error); if (abStatus == ABAuthorizationStatus.NotDetermined) { addressBook.RequestAccess((g, err) => { if (!g) { Console.WriteLine("User denied address book access!"); } else { this.InvokeOnMainThread(() =>this.ReadContacts(addressBook...