gpt4 book ai didi

android - Ionic 3 Deeplinking - 从 URL 启动应用程序

转载 作者:行者123 更新时间:2023-11-29 02:24:46 31 4
gpt4 key购买 nike

我正在使用 Ionic 开发跨平台应用程序,在尝试实现深度链接时,我安装了一个名为 Deeplinks

的 Ionic Native 插件

我运行了这些命令:

ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=roor --variable DEEPLINK_SCHEME=http --variable DEEPLINK_HOST=roor.com --variable ANDROID_PATH_PREFIX=/

npm install --save @ionic-native/deeplinks

为了测试,我做了一个代码笔并添加了以下html

<h3>
<a href="roor://roor.com">scheme</a>
</h3>

<h3>
<a href="http://www.roor.com">url</a>
</h3>

我的应用程序在点击 scheme 时确实启动了,但在点击 url 时没有任何反应。

如何从 URL

打开我的应用程序

我还找到了一篇关于深度链接的文章:https://blog.ionicframework.com/deeplinking-in-ionic-apps/

其中指出

To configure iOS and Android, we need to enable Universal Links for iOS, and App Links for Android (6.0+). This process is primarily done on the server side of your website. You’ll publish a specific json file for iOS and one for Android, ensure your site is using HTTPS, and then configure your app to open in response to links to that domain.

但我不确定应该发布什么 json 文件以从 URL 启用 deeplinknig?

最佳答案

您必须将 ./static/.well-known/assetlinks.json 文件发布到您的服务器才能与 android 一起使用,而 ./static/.well-known/适用于 iOS 的 apple-app-site-association

他们的名字令人困惑 DEEPLINK_SCHEME 用于 HTTPS 上的通用/应用程序链接,而 URL_SCHEME 用于旧的自定义方案,如 myapp://

关于android - Ionic 3 Deeplinking - 从 URL 启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52907211/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com