Setting up deep-linking for your app is easy.You just need a small url using which you want to open your app.
Follow the steps to set up deep-linking for your app.
Lets create a project and name it DeepLinkPOC.
Now select your project target.
After selecting target,select the 'info' tab.
Scroll down to the bottom until you see an option of URL Types
Click '+' option.
You will see URL schemes add a string using which you want to open your app.Lets add "DeepLinking" in URL schemes.
So, to open your app you can launch it by typing "DeepLinking://" into your safari. Your deep-linking string has following format.
[scheme]://[host]/[path] --> DeepLinking://path/Page1
where, Scheme : "DeepLinking" Host : "path" path : "Page1"
Note : Even if don't add host and path it will launch the app,so no worries.But you can add host and path to additionally redirect to particular page after application launch.
Swift:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool
Objective-c:
-(BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
The above method is called whenever your app is launched using a deep-linking string you set for your app.
Now click the Run button (if you want you can add breakpoint to your didFinishLaunchingWithOptions and openURL methods to observe values)
You'll see a message "Waiting for DeepLinkPOC(or your app name) to launch".
Open safari and type in "DeepLinking://" into the search bar this will show prompt "open this page in DeepLinkPOC" click open to launch your app.
Hope you got to know how to set up deep-linking for your app :)