Editar

Compartir a través de


UIApplication.CanOpenUrl(NSUrl) Method

Definition

Determines whether the given URL can be opened by OpenUrl.

[Foundation.Export("canOpenURL:")]
public virtual bool CanOpenUrl (Foundation.NSUrl url);
abstract member CanOpenUrl : Foundation.NSUrl -> bool
override this.CanOpenUrl : Foundation.NSUrl -> bool

Parameters

url
NSUrl

The URL to probe.

This parameter can be null.

Returns

true if there is an application registered to open the URL, false if not.

Attributes

Remarks

This function probes whether there is a handler for the provided URL on the system. For example, if you call this function with "tel://555-123-1234" on an iPhone, this will return true, but will return false on an iPod Touch.

This function does not validate the URL, it merely checks whether a handler for this URL has been installed on the system.

If you want to define your own URL handlers, edit your Info.plist file and define a new URL type, you then must update your FinishedLaunching(UIApplication, NSDictionary) method (to handle launching the application if it is not already running) and override the M:UIKit.UIApplicationDelegate.OpenUrl* method to handle the request to open the URL.

Applies to