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

Syntax

[MonoTouch.ObjCRuntime.iOS(6, 0)]
public void RequestAccess (Action<bool, MonoTouch.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 MonoTouch.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: MonoTouch.AddressBook
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0