2017-09-22 3 views
0

私はiOSアプリケーションでディープリンクを使用しています。 アプリがインストールされている場合、ディープリンクが開き、アプリが初期ビューコントローラとは異なるビューコントローラを表示します。 アプリケーションがインストールされていない場合、ユーザーはAppStoreにリダイレクトされます。AppStoreでアプリを開くときにディープリンクが機能しない

ブランチのドキュメントによれば、アプリがAppStoreにリダイレクトされた場合でも、特定のパラメータを送信することができます(通常のように)。しかし正常ではありません。 appstoreのインストール後(appstoreへのリダイレクト後)にアプリケーションを開くと、ブランチを介して通常開く新しいView Controllerが開かれません(アプリケーションが既に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

支店は素晴らしいサポートしています。彼らはあなたのすべての質問に答えます。私がメールで持っていたすべての議論の後に。私は枝を使って私の逆配線のループホールがどこにあるのか分かりました。

私たちがバックエンドから送信したリンクには、バックスラッシュ(**)が含まれていますが、ブランチは**アンパサンド(&)を受け入れています。私たちがバックスラッシュをアンパサンドに置き換えたとき、それは働き始めました。

関連する問題