Instance Method

requestAccessToAccounts(with:options:completion:)

Obtains permission to access protected user properties.

Declaration

func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!)

Parameters

accountType

The account type.

options

A dictionary of options, if options are required by the account type; otherwise, nil.

completion

The handler to call when the request has completed. The handler is called on an arbitrary queue.

Discussion

Certain account types (such as Facebook) require an options dictionary. This method will throw an NSInvalidArgumentException if the options dictionary is not provided for such account types. Conversely, if the account type does not require an options dictionary, the options parameter must be nil.

See Also

Requesting Access

typealias ACAccountStoreRequestAccessCompletionHandler

Specifies a handler to call when access is granted or denied.