ABAddressBook.RequestAccess(Action<Boolean,NSError>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Presents the user with a standard permissions dialog, requesting access to the address book.
public void RequestAccess (Action<bool,Foundation.NSError> onCompleted);
member this.RequestAccess : Action<bool, Foundation.NSError> -> unit
Parameters
Action called after the user has interacte with the permissions dialog.
Remarks
User's must give applications permission to access the 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.
NSError error;
addressBook = ABAddressBook.Create (out error);
if (addressBook != null) {
addressBook.RequestAccess (delegate (bool granted, NSError accessError) {
InvokeOnMainThread(() => accessStatus.Text = "Access " + (granted ? "allowed" : "denied"));
});
}
Applies to
See also
- <xref:AddressBook.ABAddressBok.GetAuthorizationStatus>