我为我在 branch.io 上注册的应用程序创建了深层链接。我使用消息、电子邮件、FB 发送了网址。当用户单击该链接时,如果安装了应用程序,它将根据条件重定向,然后打开应用程序并显示 Deeplink 视图控制器,如果未安装应用程序,则使用此应用程序打开应用程序商店。但是当应用程序安装并且用户单击链接应用程序时,我遇到了问题不会使用 deeplink 视图控制器自动打开,它将显示空白视图 2 秒,然后关闭该视图。
请帮我 。
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];
}
}
}
}];