UIKit.UIApplicationDelegate.OpenUrl Method
Indicates that the application should open the specified url.

Syntax

[Foundation.Export("application:openURL:sourceApplication:annotation:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_4_2)]
public virtual bool OpenUrl (UIApplication application, Foundation.NSUrl url, string sourceApplication, Foundation.NSObject annotation)

Parameters

application
Reference to this application (UIApplication.SharedApplication).
url
The Foundation.NSUrl specified by the calling application.
sourceApplication
The bundle ID of the calling application.
annotation
Optional property-list data passed by the calling application.

Returns

true if the application succcessfully handled the url.

Remarks

When overridden, the application should open the url and return a boolean indicating whether the retrieval was successful.

If the origin of the request was another application, the methods UIApplicationDelegate.WillFinishLaunching and UIApplicationDelegate.FinishedLaunching will be called prior to this method and can be used to prevent this method from being called.

If the url originated in a UIKit.UIDocumentInteractionController, the annotation may contain additional information specified by the sourceApplication. Files sent via UIKit.UIDocumentInteractionController will be in the application's Documents/Inbox directory. Applications do not have write access to this directory, so if the file needs to be modified, it must be moved to a write-enabled directory. If the file is protected and the user locks the device, it will be inaccessible. (see UIApplicationDelegate.ProtectedDataDidBecomeAvailable and UIApplication.ProtectedDataAvailable).

Applications that wish to be activated using UIApplicationDelegate.OpenURL must set the CFBundleURLTypes in their Info.plist file, as a child of the <plist><dict> element. The following example shows how a viewer to handle the URL scheme foo://host:port/path?query might be declared:

XML Example

<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleURLName</key>
		<string>com.xamarin.MyUniqueIdentifier</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>foo</string>
		</array>
		<key>CFBundleURLTypes</key>
		<string>Viewer</string>
	</dict>
</array>
              

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0