"Safari cannot open the page because the address is invalid" 在卸载应用程序的情况下访问 Branch link 时出现
"Safari cannot open the page because the address is invalid" appearing when accessing Branch link with app uninstalled
我正在将一个应用程序与 Branch.io 集成,但在 Safari 中遇到了一个问题(我已经在 iOS 11 上对此进行了测试,但该问题也可能出现在其他版本上)。
基本上,如果我安装了我的应用程序并在 Safari 或 Chrome 中快速打开 link,一切正常,我会收到在应用程序。但是,如果我 卸载应用程序 并点击 Safari 中的 link 我会收到以下消息:
当我点击“确定”按钮时,系统提示我打开 Appstore,这是我想要的行为。有什么方法可以防止 "Safari cannot open the page because the address is invalid" 消息出现吗?我尝试在未安装应用程序的情况下在 Chrome 中打开 link,并且一切正常。
我使用了官方设置指南并输入了我的 URI 方案,但禁用了通用链接,因为我自己处理这些。这会导致问题吗?
Aaron 来自 Branch.io 这里
您收到此错误的原因可能是 Branch 在未安装应用程序时尝试通过 URI 方案启动您的应用程序。从 iOS 9.2 开始,Apple 不再正式支持深层链接的 URI 方案,强烈建议开发人员实施通用链接,以便在 iOS.
上获得等效功能
具体而言,自定义 URI 方案存在重大缺陷,最明显的是无法轻松处理这两种情况:
- 未安装应用程序时。
- 当多个应用程序尝试声明 myapp://.
因此,我们建议您在 Branch 仪表板中启用通用链接。您需要做的就是提供您的捆绑包 ID 和应用程序前缀,Branch 将为您托管 AASA 文件。
我也遇到了这个问题,但我发现按照分支测试应用程序测试部分中的说明,我能够在没有 Safari 警告的情况下打开该应用程序。
https://github.com/BranchMetrics/ios-branch-deep-linking/tree/master/Branch-TestBed-Swift#test
1. If the app was installed on the test device already:
* Delete the app from the device
* Clear Safari web content, history and cookies (Settings > Safari > Clear History and Website Data)
* Reset the device's IDFA (Settings > Privacy > Advertising > Reset Advertising Identifier...)
2. Create a Marketing link from the Branch dashboard
3. Paste the link into Notes on an iPhone
4. Tap the link - you will get redirected to the web page
5. ...
希望对大家有所帮助。
来自您的 Apple 仪表板的这些 ID 和前缀:https://developer.apple.com/account/ios/identifier/bundle
- 将 ASAA 文件添加到您的服务器
如果很快,创建文件 https://yourdomain.com/.well-known/apple-app-site-association
(没有 .json)。
文件内容(这是我的,不确定到底需要哪个对象,我都添加了):
{
"applinks": {
"apps": [],
"details": [
{
"appID": "YOURPREFIX.com.your.id",
"paths": [ "*" ]
},
{
"appID": "com.your.id",
"paths": [ "*" ]
}
]
}
}
希望它能帮助一些人在没有错误的基础工作链接和自动打开应用程序。
从 iOS14 开始,应用程序不再直接向网络服务器发送 AASA 文件请求。相反,他们将这些请求发送到专用于关联域的 Apple 管理的内容分发网络 (CDN)。
请看这里:https://developer.apple.com/documentation/safariservices/supporting_associated_domains
我正在将一个应用程序与 Branch.io 集成,但在 Safari 中遇到了一个问题(我已经在 iOS 11 上对此进行了测试,但该问题也可能出现在其他版本上)。
基本上,如果我安装了我的应用程序并在 Safari 或 Chrome 中快速打开 link,一切正常,我会收到在应用程序。但是,如果我 卸载应用程序 并点击 Safari 中的 link 我会收到以下消息:
当我点击“确定”按钮时,系统提示我打开 Appstore,这是我想要的行为。有什么方法可以防止 "Safari cannot open the page because the address is invalid" 消息出现吗?我尝试在未安装应用程序的情况下在 Chrome 中打开 link,并且一切正常。
我使用了官方设置指南并输入了我的 URI 方案,但禁用了通用链接,因为我自己处理这些。这会导致问题吗?
Aaron 来自 Branch.io 这里
您收到此错误的原因可能是 Branch 在未安装应用程序时尝试通过 URI 方案启动您的应用程序。从 iOS 9.2 开始,Apple 不再正式支持深层链接的 URI 方案,强烈建议开发人员实施通用链接,以便在 iOS.
上获得等效功能具体而言,自定义 URI 方案存在重大缺陷,最明显的是无法轻松处理这两种情况:
- 未安装应用程序时。
- 当多个应用程序尝试声明 myapp://.
因此,我们建议您在 Branch 仪表板中启用通用链接。您需要做的就是提供您的捆绑包 ID 和应用程序前缀,Branch 将为您托管 AASA 文件。
我也遇到了这个问题,但我发现按照分支测试应用程序测试部分中的说明,我能够在没有 Safari 警告的情况下打开该应用程序。
https://github.com/BranchMetrics/ios-branch-deep-linking/tree/master/Branch-TestBed-Swift#test
1. If the app was installed on the test device already:
* Delete the app from the device
* Clear Safari web content, history and cookies (Settings > Safari > Clear History and Website Data)
* Reset the device's IDFA (Settings > Privacy > Advertising > Reset Advertising Identifier...)
2. Create a Marketing link from the Branch dashboard
3. Paste the link into Notes on an iPhone
4. Tap the link - you will get redirected to the web page
5. ...
希望对大家有所帮助。
来自您的 Apple 仪表板的这些 ID 和前缀:https://developer.apple.com/account/ios/identifier/bundle
- 将 ASAA 文件添加到您的服务器
如果很快,创建文件 https://yourdomain.com/.well-known/apple-app-site-association
(没有 .json)。
文件内容(这是我的,不确定到底需要哪个对象,我都添加了):
{
"applinks": {
"apps": [],
"details": [
{
"appID": "YOURPREFIX.com.your.id",
"paths": [ "*" ]
},
{
"appID": "com.your.id",
"paths": [ "*" ]
}
]
}
}
希望它能帮助一些人在没有错误的基础工作链接和自动打开应用程序。
从 iOS14 开始,应用程序不再直接向网络服务器发送 AASA 文件请求。相反,他们将这些请求发送到专用于关联域的 Apple 管理的内容分发网络 (CDN)。
请看这里:https://developer.apple.com/documentation/safariservices/supporting_associated_domains