AddressBook.ABAddressBook.RequestAccess Method
Presents the user with a standard permissions dialog, requesting access to the address book.

Syntax

[ObjCRuntime.iOS(6, 0)]
public void RequestAccess (Action<bool, Foundation.NSError> onCompleted)

Parameters

onCompleted
Action called after the user has interacte with the permissions dialog.

Remarks

User's must give applications permission to access the AddressBook.ABAddressBook. This is done with a standard permissions dialog that is shown asynchronously (if necessary) by calling this asynchronous. The onCompleted Action is called after the user has interacted with the dialog.

C# Example

NSError error;
addressBook = ABAddressBook.Create (out error);

if (addressBook != null) {
	addressBook.RequestAccess (delegate (bool granted, NSError accessError) {
		InvokeOnMainThread(() => accessStatus.Text = "Access " + (granted ? "allowed" : "denied"));
	});
}
          

Requirements

Namespace: AddressBook
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0