Deep Linking not working when app is in background?












0















I am using following method to implement deep linking.



 - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation


When app is in background this method is not calling when I came from browser?.
I have added all required procedures to implement deep linking.

How to solve this ?










share|improve this question

























  • Try implementing this one instead application:continueUserActivity:restorationHandler:

    – Evgeniy
    Nov 15 '18 at 6:48













  • Tried but that method not calling.What should I do to get called that method ?

    – Uday Kumar Eega
    Nov 15 '18 at 6:52











  • Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

    – Evgeniy
    Nov 15 '18 at 8:25
















0















I am using following method to implement deep linking.



 - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation


When app is in background this method is not calling when I came from browser?.
I have added all required procedures to implement deep linking.

How to solve this ?










share|improve this question

























  • Try implementing this one instead application:continueUserActivity:restorationHandler:

    – Evgeniy
    Nov 15 '18 at 6:48













  • Tried but that method not calling.What should I do to get called that method ?

    – Uday Kumar Eega
    Nov 15 '18 at 6:52











  • Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

    – Evgeniy
    Nov 15 '18 at 8:25














0












0








0








I am using following method to implement deep linking.



 - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation


When app is in background this method is not calling when I came from browser?.
I have added all required procedures to implement deep linking.

How to solve this ?










share|improve this question
















I am using following method to implement deep linking.



 - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation


When app is in background this method is not calling when I came from browser?.
I have added all required procedures to implement deep linking.

How to solve this ?







ios objective-c deep-linking openurl






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 6:49









rmaddy

243k27321382




243k27321382










asked Nov 15 '18 at 6:38









Uday Kumar EegaUday Kumar Eega

80112




80112













  • Try implementing this one instead application:continueUserActivity:restorationHandler:

    – Evgeniy
    Nov 15 '18 at 6:48













  • Tried but that method not calling.What should I do to get called that method ?

    – Uday Kumar Eega
    Nov 15 '18 at 6:52











  • Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

    – Evgeniy
    Nov 15 '18 at 8:25



















  • Try implementing this one instead application:continueUserActivity:restorationHandler:

    – Evgeniy
    Nov 15 '18 at 6:48













  • Tried but that method not calling.What should I do to get called that method ?

    – Uday Kumar Eega
    Nov 15 '18 at 6:52











  • Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

    – Evgeniy
    Nov 15 '18 at 8:25

















Try implementing this one instead application:continueUserActivity:restorationHandler:

– Evgeniy
Nov 15 '18 at 6:48







Try implementing this one instead application:continueUserActivity:restorationHandler:

– Evgeniy
Nov 15 '18 at 6:48















Tried but that method not calling.What should I do to get called that method ?

– Uday Kumar Eega
Nov 15 '18 at 6:52





Tried but that method not calling.What should I do to get called that method ?

– Uday Kumar Eega
Nov 15 '18 at 6:52













Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

– Evgeniy
Nov 15 '18 at 8:25





Here's a good tutorial, covering both iOS and backend parts of it. medium.com/@abhimuralidharan/…

– Evgeniy
Nov 15 '18 at 8:25












2 Answers
2






active

oldest

votes


















1














try this.



 func application(_ application: UIApplication, continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
guard let dynamicLinks = FIRDynamicLinks.dynamicLinks() else {

return false
}

let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
print(error as Any)
}


return handled
}





share|improve this answer































    0














    #define App_Scheme   @"yourbundleappschme"

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
    sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    {
    if ([[url scheme] isEqualToString:App_Scheme])
    {
    NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
    NSLog(@"URL scheme:%@", [url scheme]);
    NSLog(@"URL query: %@", [url query]);
    return YES;
    }
    return NO;
    }


    Also Add in Delegate



    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
    //handle here
    if ([[url scheme] isEqualToString:App_Scheme])
    {
    NSLog(@"URL scheme:%@", [url scheme]);
    NSLog(@"URL query: %@", [url query]);
    return YES;
    }
    return FALSE;
    }


    Also add
    Project - > Target - > Capabilites -> Associated Domains -> Add your domain with



    App links: domain here






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313752%2fdeep-linking-not-working-when-app-is-in-background%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      try this.



       func application(_ application: UIApplication, continue userActivity: NSUserActivity,
      restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
      guard let dynamicLinks = FIRDynamicLinks.dynamicLinks() else {

      return false
      }

      let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
      print(error as Any)
      }


      return handled
      }





      share|improve this answer




























        1














        try this.



         func application(_ application: UIApplication, continue userActivity: NSUserActivity,
        restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
        guard let dynamicLinks = FIRDynamicLinks.dynamicLinks() else {

        return false
        }

        let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
        print(error as Any)
        }


        return handled
        }





        share|improve this answer


























          1












          1








          1







          try this.



           func application(_ application: UIApplication, continue userActivity: NSUserActivity,
          restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
          guard let dynamicLinks = FIRDynamicLinks.dynamicLinks() else {

          return false
          }

          let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
          print(error as Any)
          }


          return handled
          }





          share|improve this answer













          try this.



           func application(_ application: UIApplication, continue userActivity: NSUserActivity,
          restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
          guard let dynamicLinks = FIRDynamicLinks.dynamicLinks() else {

          return false
          }

          let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
          print(error as Any)
          }


          return handled
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 12:49









          Swati DesaiSwati Desai

          114




          114

























              0














              #define App_Scheme   @"yourbundleappschme"

              - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
              sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
              {
              if ([[url scheme] isEqualToString:App_Scheme])
              {
              NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
              NSLog(@"URL scheme:%@", [url scheme]);
              NSLog(@"URL query: %@", [url query]);
              return YES;
              }
              return NO;
              }


              Also Add in Delegate



              - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
              //handle here
              if ([[url scheme] isEqualToString:App_Scheme])
              {
              NSLog(@"URL scheme:%@", [url scheme]);
              NSLog(@"URL query: %@", [url query]);
              return YES;
              }
              return FALSE;
              }


              Also add
              Project - > Target - > Capabilites -> Associated Domains -> Add your domain with



              App links: domain here






              share|improve this answer




























                0














                #define App_Scheme   @"yourbundleappschme"

                - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
                sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
                {
                if ([[url scheme] isEqualToString:App_Scheme])
                {
                NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
                NSLog(@"URL scheme:%@", [url scheme]);
                NSLog(@"URL query: %@", [url query]);
                return YES;
                }
                return NO;
                }


                Also Add in Delegate



                - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
                //handle here
                if ([[url scheme] isEqualToString:App_Scheme])
                {
                NSLog(@"URL scheme:%@", [url scheme]);
                NSLog(@"URL query: %@", [url query]);
                return YES;
                }
                return FALSE;
                }


                Also add
                Project - > Target - > Capabilites -> Associated Domains -> Add your domain with



                App links: domain here






                share|improve this answer


























                  0












                  0








                  0







                  #define App_Scheme   @"yourbundleappschme"

                  - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
                  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
                  {
                  if ([[url scheme] isEqualToString:App_Scheme])
                  {
                  NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
                  NSLog(@"URL scheme:%@", [url scheme]);
                  NSLog(@"URL query: %@", [url query]);
                  return YES;
                  }
                  return NO;
                  }


                  Also Add in Delegate



                  - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
                  //handle here
                  if ([[url scheme] isEqualToString:App_Scheme])
                  {
                  NSLog(@"URL scheme:%@", [url scheme]);
                  NSLog(@"URL query: %@", [url query]);
                  return YES;
                  }
                  return FALSE;
                  }


                  Also add
                  Project - > Target - > Capabilites -> Associated Domains -> Add your domain with



                  App links: domain here






                  share|improve this answer













                  #define App_Scheme   @"yourbundleappschme"

                  - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
                  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
                  {
                  if ([[url scheme] isEqualToString:App_Scheme])
                  {
                  NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
                  NSLog(@"URL scheme:%@", [url scheme]);
                  NSLog(@"URL query: %@", [url query]);
                  return YES;
                  }
                  return NO;
                  }


                  Also Add in Delegate



                  - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
                  //handle here
                  if ([[url scheme] isEqualToString:App_Scheme])
                  {
                  NSLog(@"URL scheme:%@", [url scheme]);
                  NSLog(@"URL query: %@", [url query]);
                  return YES;
                  }
                  return FALSE;
                  }


                  Also add
                  Project - > Target - > Capabilites -> Associated Domains -> Add your domain with



                  App links: domain here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 16 '18 at 13:20









                  9to5ios9to5ios

                  3,15522052




                  3,15522052






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313752%2fdeep-linking-not-working-when-app-is-in-background%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Xamarin.iOS Cant Deploy on Iphone

                      Glorious Revolution

                      Dulmage-Mendelsohn matrix decomposition in Python