分支深层链接未打开应用程序 [英] Branch Deep link not opening application

查看:196
本文介绍了分支深层链接未打开应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试(不成功)使用分支来实现深入链接到我们的iOS应用程序。分支URL直接重定向到App Store,从不尝试打开应用程序。我必须遗漏一些东西。

I have been trying (unsuccessfully) to use Branch to implement deep linking into our iOS application. The Branch URL redirects directly to App Store and never attempts to open the application. I must be missing something.

我做了什么:


  1. 包括Branch SDK(CocoaPods)将 branch_key 添加到应用程序
    plist

  2. 在应用程序plist中为URL类型添加了URL方案

  3. 在项目和开发人员控制台
    中的App ID中启用关联域

  4. 确保授权文件包含在构建中。

  1. Included Branch SDK (CocoaPods) Added branch_key to application plist
  2. Added URL Scheme to URL Types in application plist
  3. EnabledAssociated Domains in both the project and the App ID in the developer console.
  4. Ensured that the entitlements file is included in the build.

AppDelegate中注册的深层链接处理程序

Registered deep link handler in AppDelegate

仪表板:设置 - >链接设置:

Dashboard: Settings -> Link Settings:


  1. 总是尝试打开应用程序已检查

  2. IOS URI Scheme设置为应用程序的自定义URI方案。

  3. 启用通用链接已选中。

  4. 捆绑标识符& Apple App Prefix都设置正确。

  1. "Always try to open app" is checked
  2. "IOS URI Scheme" is set to the application's custom URI scheme.
  3. "Enable Universal Links" is checked.
  4. Bundle Identifier & Apple App Prefix are both set correctly.

在分支仪表板中的营销标签下,我创建了一个链接。我正在通过电子邮件将此链接发送给自己并在设备上打开它(Mail.app)。 Safari打开然后App Store打开就像没有安装应用程序一样。

Within the Branch Dashboard, under "Marketing" tab, I've created a single link. I'm emailing this link to myself and opening it on the device (Mail.app). Safari opens then the App Store is opened as if the application is not installed.

application:openURL:sourceApplication:annotation nor application:continueUserActivity:restorationHandler 被调用。

AppDelegate方法:

AppDelegate Methods:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let branch: Branch = Branch.getInstance()
    branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { params, error in
        if (error == nil) {
            // 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 ...
            NSLog("params: %@", params.description)
        }
    })
    return true
}

func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool {
    // pass the url to the handle deep link call

    return Branch.getInstance().continueUserActivity(userActivity)
}

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    // pass the url to the handle deep link call
    Branch.getInstance().handleDeepLink(url);

    // do other deep link routing for the Facebook SDK, Pinterest SDK, etc
    return true
}

我错过了配置步骤吗?这是因为应用程序是通过Xcode调试而不是通过应用商店安装的?我希望看到调用的应用程序委托方法,但它们不是。

Am I missing a configuration step? Is this because the application is installed via Xcode debug and not through the app store? I'm expecting to see the application delegate methods called, but they are not.

推荐答案

似乎必须安装应用程序通过App Store / Test Flight / Ad Hoc或该应用程序将不被视为已安装。

It appears that the application must be installed via App Store/Test Flight/Ad Hoc or the application will not be considered installed.

我使用Ad Hoc规定将应用程序安装到我的设备上,一切正常。

I installed the application to my device using an Ad Hoc provision and everything is working.

这篇关于分支深层链接未打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆