iOS Deep Linking in iOS Opening an app based on its URL scheme

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

To open an app with defined URL scheme todolist://:

Objective-C

NSURL *myURL = [NSURL URLWithString:@"todolist://there/is/something/to/do"];
[[UIApplication sharedApplication] openURL:myURL];

Swift

let stringURL = "todolist://there/is/something/to/do"
if let url = NSURL(string: stringURL) {
    UIApplication.shared().openURL(url)
}

HTML

<a href="todolist://there/is/something/to/do">New SMS Message</a>

Note: It's useful to check if link can be opened to otherwise display an appropriate message to the user. This can be done using canOpenURL: method.



Got any iOS Question?