Instance Method


Attempts to open the resource at the specified URL asynchronously.


- (void)openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id> *)options completionHandler:(void (^)(BOOL success))completion;



A URL (Universal Resource Locator). The resource identified by this URL may be local to the current app or it may be one that must be provided by a different app. UIKit supports many common schemes, including the http, https, tel, facetime, and mailto schemes. You can also employ custom URL schemes associated with apps installed on the device.


A dictionary of options to use when opening the URL. For a list of possible keys to include in this dictionary, see UIApplicationOpenExternalURLOptionsKey.


The block to execute with the results. Provide a value for this parameter if you want to be informed of the success or failure of opening the URL. This block is executed asynchronously on your app's main thread. The block has no return value and takes the following parameter:


A Boolean indicating whether the URL was opened successfully.


Use this method to open the specified resource. If the specified URL scheme is handled by another app, iOS launches that app and passes the URL to it. (Launching the app brings the other app to the foreground.) If no app is capable of handling the specified scheme, the completion handler is called with the success parameter set to NO.

To determine whether an app is installed that is capable of handling the URL, call the canOpenURL: method before calling this one. Be sure to read the description of that method for an important note about registering the schemes you want to employ.

See Also

Opening a URL Resource

- canOpenURL:

Returns a Boolean value indicating whether an app is available to handle a URL scheme.


Options for opening a URL.


Used to create a URL that you can pass to the openURL: method. When you open the URL built from this string, the system launches the Settings app and displays the app’s custom settings, if it has any.