Instance Method

openURL:completionHandler:

Asks the system to open a URL on behalf of the currently running app extension.

Declaration

- (void)openURL:(NSURL *)URL completionHandler:(void (^)(BOOL success))completionHandler;

Parameters

URL

The URL to open.

completionHandler

A block to be called when the URL has opened.

The block takes the following parameter:

success

A Boolean value that indicates whether the open operation was successful.

Discussion

Each extension point determines whether to support this method, or under which conditions to support this method. In iOS, the Today and iMessage app extension points support this method. An iMessage app extension can use this method only to open its parent app, and only if the parent app is shown on the iOS home screen.