0
我已經使用Branch.io創建了我的應用程序的深層鏈接。但每次啓動應用程序時,它都會將我重定向到深層鏈接控制器。Branch.io Deeplink每次啓動應用程序時都會打開深層鏈接
我用下面的代碼中 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Branch *branch = [Branch getInstance];
HomeDetailsViewController *controller = (HomeDetailsViewController*)[[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"HomeDetailsViewControllerID"];
[branch registerDeepLinkController:controller forKey:@"bucketId"];
[branch initSessionWithLaunchOptions:launchOptions automaticallyDisplayDeepLinkController:YES];
..
// Respond to Universal Links - Branch io
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
BOOL handledByBranch = [[Branch getInstance] continueUserActivity:userActivity];
return handledByBranch;
}
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options NS_AVAILABLE_IOS(9_0) {
[[Branch getInstance] handleDeepLink:url];
[self application:app
processOpenURLAction:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
iosVersion:9];
return YES;
}
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
[[Branch getInstance] handleDeepLink:url];
[self application:application
processOpenURLAction:url
sourceApplication:sourceApplication
annotation:annotation
iosVersion:8];
return YES;
}
是的,我也實現了這個代碼,但它也返回了對於參數'clicked_branch_link'是,即使鏈接沒有被點擊。我認爲它可以在某些地方爲它的偏好節省價值。但是當我通過測試飛行測試它時,它工作正常。 –
來自Branch.io的Alex在這裏:如果您正在進行廣泛的測試,可能會有多個鏈接點擊排隊等待該設備ID,並且SDK只需要按順序清除它們。如果您仍然有問題,請告訴我! –
我有同樣的問題,我該如何清理? @AlexBauer – ovidiur