0

I create deep link for my application which is register on branch.io . I sent the url using message,email,FB. When user clicked on that link it is redirecting base on condition if app installed then open app and show Deeplink view controller if app not installed then open app store with this app.But i am facing issue , when app installed and user clicked on link app not automatically open with deeplink view controller it will show blank view for 2 seconds and after it will close that view.

Please help me .

CODE IN DID FINISH LUNCHING

         //Branch.io
            Branch *branch = [Branch getInstance];
            [branch initSessionWithLaunchOptions:launchOptions automaticallyDisplayDeepLinkController:YES]; 

....
CODE FOR NAVIGATION CONTROLLER
....

//Registered DEEPLINK VC 
    DeepLinkVC *controllerDeepLink = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"DeepLinkingController"];
        [branch setDebug];
        [branch registerDeepLinkController:controllerDeepLink forKey:@"sms"];

        NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];


        [branch initSessionWithLaunchOptions:dictionary isReferrable:YES andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {

            if ([params valueForKey:@"questionId"])
            {
                 //CHECK FOR LOGIN 
                if([kNSUserDefaults objectForKey:kUserId] != nil)
                {
                    controllerDeepLink.dicPost=params;
                    UINavigationController *currNavi = (UINavigationController *)tabBar_Controller.selectedViewController;
                    id tempDeepVC   =[[currNavi viewControllers] lastObject];
                    if ([tempDeepVC isKindOfClass:[DeepLinkVC class]] == NO)
                    {
                       [currNavi pushViewController:controllerDeepLink animated:YES];
                    }
                }

            }

        }];
Jay Mehta
  • 1,431
  • 19
  • 40
  • 1
    Jay, I just sent you an email with several suggestions. The most important part is you need a unified initSession call. Give it a look. – st.derrick Oct 05 '15 at 18:46
  • Hi @st.derrick, Thanks for replay . I have added entitlements file for support universal link in iOS 9, with keys com.apple.developer.associated-domains (array) with two keys 1) applinks:bnc.lt 2) applinks:link.appName.com but it not working . When i clicked on branch.io link in iOS 9 it will open safari browser not open direct app .. , i have also added method in appdelegate for handel link . Can you please help for same ? – Jay Mehta Oct 06 '15 at 12:09
  • I just followed up with you via email. Please shoot me over more detailed information per my requests in that email. – st.derrick Oct 12 '15 at 20:27
  • 1
    @st.derrick Could you post an answer here as well ? I am facing a similar problem. – Shivam Bhalla Dec 22 '15 at 05:46
  • 1
    @st.derrick it will be helpful for others as well if you can post your answer. What's the purpose of asking a question on SO? – sKhan Jan 31 '16 at 22:30
  • I compiled several common issues on this answer: http://stackoverflow.com/questions/32751225/ios9-universal-links-does-not-work/32751734#32751734 – st.derrick Feb 01 '16 at 17:34
  • If you're having problems directly related to which View Controllers to show when, please post code snippets similar to the one Jay posted above – st.derrick Feb 01 '16 at 17:35

0 Answers0