如何实现DeepLinking如果用户没有应用程序呢? [英] How to implement DeepLinking If user don't have app then?

查看:125
本文介绍了如何实现DeepLinking如果用户没有应用程序呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我的项目的DeepLink或通用链接有3个要求.

I have 3 requirement for DeepLinking or Universal Links to my project.

  1. 如果用户正在使用该应用程序,则UR​​L应该重定向到包含内容的应用程序.
  2. 如果用户没有该应用程序,则应将其重定向到Appstore.
  3. 如果用户没有该应用程序,则应将其重定向到Appstore,并在下载该应用程序后将其转到包含我通过URL发送的数据的页面.

我关注的链接:

  1. https://www.raywenderlich.com/128948/universal-links -make-connection
  2. https://developer.apple.com /library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html .
  3. http://swiftdeveloperblog.com/deep-linking-using-自定义网址方案/.
  4. http://blogs.innovationm. com/deferred-deep-linking-in-ios-with-universal-link/
  5. https://developer.apple.com/documentation/security/shared_web_credentials/preparing_your_app_and_site
  6. http://www.brianjcoleman.com/tutorial-deep-迅捷链接/.
  1. https://www.raywenderlich.com/128948/universal-links-make-connection
  2. https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html.
  3. http://swiftdeveloperblog.com/deep-linking-using-custom-url-scheme/.
  4. http://blogs.innovationm.com/deferred-deep-linking-in-ios-with-universal-link/
  5. https://developer.apple.com/documentation/security/shared_web_credentials/preparing_your_app_and_website_to_share
  6. http://www.brianjcoleman.com/tutorial-deep-linking-in-swift/.

我了解的是:

创建和上传关联文件,为此,我必须执行一些步骤:

Creating and Uploading the Association File and for this I have to follow some steps:

添加对通用链接的支持很容易.您需要执行三个步骤:

Adding support for universal links is easy. There are three steps you need to take:

创建一个apple-app-site-association文件,其中包含有关您的应用程序可以处理的URL的JSON数据.将apple-app-site-association文件上传到HTTPS Web服务器.您可以将文件放在服务器的根目录或.well-known子目录中.准备您的应用程序以处理通用链接.

Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle. Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root of your server or in the .well-known subdirectory. Prepare your app to handle universal links.

创建和上传关联文件

要在网站和应用程序之间建立安全连接,请在它们之间建立信任关系.您可以分为两部分来建立这种关系:

To create a secure connection between your website and your app, you establish a trust relationship between them. You establish this relationship in two parts:

您添加到网站的apple-app-site-association文件 您添加到应用程序中的com.apple.developer.associated-domains权利

An apple-app-site-association file that you add to your website A com.apple.developer.associated-domains entitlement that you add to your app

准备处理通用链接的应用程序.
在您的com.apple.developer.associated-domains权利中,包括您的应用程序希望作为通用链接处理的域的列表.若要在Xcode中执行此操作,请在功能"选项卡中打开关联的域"部分,并为您的应用程序支持的每个域添加一个条目,并以applinks:为前缀,例如applinks:www.mywebsite.com.

Preparing Your App to Handle Universal Links.
In your com.apple.developer.associated-domains entitlement, include a list of the domains that your app wants to handle as universal links. To do this in Xcode, open the Associated Domains section in the Capabilities tab and add an entry for each domain that your app supports, prefixed with applinks:, such as applinks:www.mywebsite.com.

问题是:我遵循了所有步骤,并在我的关联域的域中添加了一个URL.

Problem is: I followed all steps and I have a url I added it in the domain in my Associated Domain.

示例:https://<My_Domain>/anything. 现在,后端正在生成URL并发送.

Example: https://<My_Domain>/anything. Now Backend is generating URL and sending.

我们正在使用Http服务器.

示例:

Route::get('appstore',function(){ return redirect()->away('https://itunes.apple.com/in/app/whatsapp-messenger/id310633997?mt=8');}); 

问题是,当我单击该URL时,我没有得到已经应用程序的任何弹出窗口,并且在下载数据后,我将如何获取?

Problem is when I am clicking on that URL I am not getting any popup for already app and also After download how data I will get ?

是否缺少某些东西或后端缺少某些东西?

Am missing something or backend is missing something?

推荐答案

因此,您似乎正在尝试完成延迟的深层链接,这意味着如果应用程序是已安装,或者将用户引导至应用商店以下载应用,并在应用打开后向他们展示内容.自己很难做到这一点,我将在后面详细解释.

So it seems like you are trying to accomplish deferred deep linking, which means you route the user to the content if the app is installed or you route the user to the app store to download the app and present them the content once the app is opened. This is very difficult to do by yourself and I'll explain more in a bit.

您似乎正确设置了通用链接,但重定向到应用商店的过程相当棘手.通用链接用于将用户重定向到网络版本,这意味着将他们带到应用商店并不是一件容易的事.

It looks like you are setting up your universal links correctly but the redirect to the app store is fairly hacky. Universal Links are meant to be used to redirect users to the web version, which means bringing them to the app store instead is no easy task.

如果您确实将用户带到了应用商店,则延迟深层链接是

If you do get the user to the app store, deferred deep linking which is just directing them to the content after they install the app is nearly impossible to do yourself without using a third-party service like Branch. Branch also will allow you to push users back to the app store to download the app, if that's the user experience your looking for.

希望这会有所帮助!

这篇关于如何实现DeepLinking如果用户没有应用程序呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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