Setting up deeplink for your app

suggest change

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.

  1. Lets create a project and name it DeepLinkPOC.
  2. Now select your project target.
  3. After selecting target,select the ‘info’ tab.
  4. Scroll down to the bottom until you see an option of URL Types
  5. Click ‘+’ option.
  6. 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.

  1. Now add following method to your appdelegate.

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.

  1. Now is the time to install your app but wait before you directly jump to run button.Lets do a small change in scheme’s app-launch method.
  1. Now click the Run button (if you want you can add breakpoint to your didFinishLaunchingWithOptions and openURL methods to observe values)
  2. You’ll see a message “Waiting for DeepLinkPOC(or your app name) to launch”.
  3. 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 :)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Deep Linking:
* Setting up deeplink for your app

Table Of Contents
12 UIView
15 UIColor
26 UIImage
28 CALayer
30 NSDate
40 iBeacon
49 NSTimer
79 NSURL
87 AWS SDK
96 NSData
98 Deep Linking
101 Segues
104 EventKit
105 NSBundle
106 SiriKit
111 StoreKit
117 3D Touch
119 Keychain
122 Block
141 AirDrop
144 UISlider
145 Carthage
146 HealthKit
151 plist
157 MVVM
164 UIPhoenix
166 Simulator
168 NSArray
169 OpenGL
175 Core Data
179 MyLayout
180 UIFont
189 Security
200 Codable