2017-09-22 12 views
0

Hie, iOS 애플리케이션의 deeplinks 지점을 사용 중입니다. 앱이 설치된 경우 딥 링크가 열리고 앱이 초기보기 컨트롤러와 다른보기 컨트롤러를 표시합니다. 앱이 설치되어 있지 않으면 사용자가 AppStore로 리디렉션됩니다.AppStore를 통해 앱을 열 때 Branch Deep Linking이 작동하지 않습니다.

브랜치의 문서에 따르면 앱이 앱 스토어로 리디렉션 된 경우에도 특정 매개 변수를 보낼 수 있습니다 (정상과 같음). 그러나 정상적으로 작동하지 않습니다. 앱 스토어 설치 후 (앱 스토어로 리디렉션 한 후) 앱이 열리면 브랜치의 디 링크 (앱이 이미 iPhone에있는 경우)를 통해 정상적으로 열리는 새로운보기 컨트롤러가 열리지 않습니다. 다음과 같이

내 코드는 다음과 같습니다

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
    // Override point for customization after application launch. 
    UserDefaults.standard.set(false, forKey: "isDataSynced") 
    UserDefaults.standard.setSecret(securePassword) 
    //  UserDefaults.standard.set(false, forKey: "DeviceIdentifiersSavedInDB") 
    CommonFunctions.sharedCommonFunctions.setUpSideMenu() 
    UserDefaults.standard.set(false, forKey: "fromBranch") 

    Branch.getInstance().initSession(launchOptions: launchOptions) { params, error in 
     // params are the deep linked params associated with the link that the user clicked -> was re-directed to this app 
     // params will be empty if no data found 
     // ... insert custom logic here ... 
     if error == nil { 
     print(params as? [String: AnyObject] ?? {}) 
      if let parameters = params as? [String : AnyObject] { 
       if let link = parameters["~referring_link"] as? String { 
        if self.validateURL(url: URL(string: link)!) { 
         UserDefaults.standard.set(false, forKey: "declinedTermsConditions") 
         UserDefaults.standard.set(true, forKey: "fromBranch") 
         let initialViewController = self.mainStoryboard.instantiateViewController(withIdentifier: "CustomSideMenuControllerViewController") as! CustomSideMenuControllerViewController 
         self.window?.rootViewController = initialViewController 
        } 
       } 
      } 
     } 
    } 

    if UserDefaults.standard.value(forKey: udiBarcode) == nil { 
      } else { 
     //Navigate to DashBoard VC 
     let initialViewController = mainStoryboard.instantiateViewController(withIdentifier: "CustomSideMenuControllerViewController") as! CustomSideMenuControllerViewController 
     self.window = UIWindow(frame: UIScreen.main.bounds) 
     self.window?.rootViewController = initialViewController 
     self.window?.makeKeyAndVisible() 
    } 

    UserDefaults.standard.set("true" , forKey: "isFirstTimeAutomationTest") 
    Fabric.with([Crashlytics.self]) 

    return true 
} 


func application(_ application: UIApplication, 
        continue userActivity: NSUserActivity, 
        restorationHandler: @escaping ([Any]?) -> Void) -> Bool { 
     Branch.getInstance().continue(userActivity) 
     return true 
    } 


func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { 
     // pass the url to the handle deep link call 
     Branch.getInstance().handleDeepLink(url) 
     return true 
    } 
+0

BranchOverflow에 지점 팀 모니터링 질문의 사람들이 있습니다. 더 많은 관심을 가지기 위해 지점 지원 티켓을 열길 원할 수 있습니다. –

답변

0

지점 놀라운 지원을하고있다. 그들은 당신의 모든 질문에 답합니다. 내가 그들과 메일에서했던 모든 토론이 끝난 후에. 나는 지점을 사용하여 내 deeplinking에서 루프 구멍이 어디인지 알아 냈다.

는 우리가 우리의 백엔드에서 전송 된 링크는 ** 앰퍼샌드 (&) 백 슬래시 (**) 지사가 수용하면서 포함되어 있습니다. 우리가 우리의 백 슬래쉬를 앰퍼샌드로 대체했을 때 그것은 작동하기 시작했습니다.