DEEP LINKING

DEEP LINKING

Deep Linking at first seems to be very heavy & new concept but its actually very useful. But lets first understand what actually deep linking is all about. Assume that you have booked the ticket from app, and you have received an email of that ticket, Email can contain deep link to your app as well as link to website. Now if you open that email from mobile you will get deep link to your app. Clicking on that link you will be redirected to ticket screen in your app.

This particular link which opens app and redirect us to ticket detail screen can be termed as “Deep Linking”. Sounds good but how do we implement this in iOS ? And how can a URL open our app ?

Yes URL can open the app, if you dont believe me try opening Safari in your mobile and type whatsapp:// this will open whats app application. Formate of deep link is <Host>://<Path>/<Query>.  Follow below step in order to achieve deep linking in your app.

Step 1 : Add URL Scheme in your info.plist

In URL Types -> item 0 -> URL Schemes -> item 0 -> ” <Replace with your custom scheme>”

To ensure this scheme is working try building the project and open safari & type <Custom Scheme>:// your application should open.

Step 2 : 

We need to write the function to implement the same in our App Delegate in order to navigate User to perticular screen depending on the parameter & query supplied in the Deep Link URL

  • -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
  • {
  • NSString *path = [url path];
  • NSString *query = [url query];
  • if ([query isEqualToString:@"1"])
  • {
  • vc = [story instantiateViewControllerWithIdentifier:@"homepage"];
  • vc1 = [story instantiateViewControllerWithIdentifier:@"firstStoryboard"];
  • self.navController=[[UINavigationController alloc] initWithRootViewController:vc];
  • [self.navController pushViewController:vc1 animated:NO];
  • self.window.rootViewController = self.navController;
  • }
  • return YES;
  • }

要查看或添加评论,请登录

BhuShan PaWaR的更多文章

  • iOS 11?—?Core ML

    iOS 11?—?Core ML

    I introduced Core ML which is a general machine learning framework. Apple also provide frameworks for specific areas.

  • Protocol-oriented Programming in Swift

    Protocol-oriented Programming in Swift

    Protocols are used to define a “blueprint of methods, properties, and other requirements that suit a particular task or…

    1 条评论
  • iOS 10 Push Notifications

    iOS 10 Push Notifications

    Images, GIFs, Audio and Video You can now send rich media in a push notification, including images, GIFs, audio, and…

    3 条评论
  • Apple Keynote Event (September 7, 2016)

    Apple Keynote Event (September 7, 2016)

    Apple has launched the two new members of IPhone Family. iPhone 7 and iPhone 7 Plus.

  • NSURLConnection to NSURLSession

    NSURLConnection to NSURLSession

    got its start a decade ago, with the original release of Safari in 2003, as an abstraction on top of the Core…

    3 条评论
  • Apple Pay

    Apple Pay

    Mobile payments are the hot phrase of the season. Since Apple Pay’s announcement in 2014 and now Samsung and…

  • IMPLEMENTING SPOTLIGHT IN YOUR APP

    IMPLEMENTING SPOTLIGHT IN YOUR APP

    Hey Readers, hope you have a great time reading the posts, today we will have a quick look at Spotlight search feature…

  • WHATS NEW IN IOS 9

    WHATS NEW IN IOS 9

    Multitasking Enhancements for iPAD For Multitasking on iPAD, iOS 9 has introduced bunch of new views which are : Slide…

    1 条评论
  • IOS9

    IOS9

    Apple has been always improvising the iOS & developer tools this time keeping in mind the smaller size devices like 8…

  • ASPECT RATIOS & AUTOLAYOUT

    ASPECT RATIOS & AUTOLAYOUT

    Auto Layout at first seems to be very boring and unresponsive, did you felt the same ? The first time I started with I…

    1 条评论

社区洞察

其他会员也浏览了