2017-09-22 1 views
0

Hie, ich benutze Zweig für Deeplinks in meiner iOS-Anwendung. Wenn die App installiert ist, öffnet sich der Deeplink und die App und zeigt einen anderen View-Controller als der ursprüngliche View-Controller. Wenn die App nicht installiert ist, wird der Benutzer zum AppStore weitergeleitet.Branch Deep Linking funktioniert nicht beim Öffnen von App über AppStore

Die Dokumentation von Branch sagt, dass wenn die App zum AppStore umgeleitet wird, können wir immer noch bestimmte Parameter senden (wie normal) Aber es funktioniert nicht. Wenn die App nach der Appstore-Installation geöffnet wird (nach der Umleitung in den Appstore), öffnet sie den neuen View-Controller nicht, der normalerweise über die Deep-Verknüpfung von Branch geöffnet wird (wenn sich die App bereits im iPhone befindet).

Mein Code ist wie folgt:

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

Es gibt Leute von Branch Team Überwachungsfragen in StackOverflow. Vielleicht möchten Sie Branch Supportticket öffnen, um mehr Aufmerksamkeit zu erhalten. –

Antwort

0

Zweig hat eine erstaunliche Unterstützung. Sie beantworten jede Ihrer Fragen. Nach all den Diskussionen, die ich mit ihnen über Mails hatte. Ich habe herausgefunden, wo das Loop-Loch in meiner Deeplinking mit Zweig war.

Der Link wir waren von unserem Backend Senden enthalten Schrägstriche (**) während der Zweig ** Et-Zeichen (&) akzeptiert. Als wir unsere Backslashes durch Ampersands ersetzt haben, fing es an zu arbeiten.