如何禁用“在应用程序中打开" iOS Safari中的横幅广告是否支持通用链接? [英] How can I disable the "open in app" banner on ios safari for pages that support universal links?

查看:274
本文介绍了如何禁用“在应用程序中打开" iOS Safari中的横幅广告是否支持通用链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过apple-app-site-association将路径注册为通用链接后,我看到在安装iOS Safari的页面加载中,当我安装了该应用程序时,系统会在该页面上注入在应用程序中打开"横幅屏幕顶部.

我想在保留此页面的通用链接支持的同时禁用此横幅.我看不到有任何官方方法可以做到这一点;有什么方法可以做到这一点,无论是多么老套或非常规?

解决方案

在下面的回答中,我意识到只有在未安装应用程序时才能加载.您试图实现的目标可能无法实现.由于AASA文件已安装在设备上,因此Safari会自动将该网页与应用程序相关联,从而将横幅广告加载到浏览器中.我不认为这是一个HTML元素,您只能通过JQuery调用将其删除.解决方案是将重定向链接用作通用链接.这样,如果安装了该应用程序,则该应用程序将打开,如果未安装,它将重定向到您的站点,该站点不会被识别为通用链接,也不会显示横幅. 分支是使用重定向的可靠的深层链接解决方案,因此您不必处理Apple横幅广告. /p>

未安装应用程序时删除标语

确保没有在页面上加载智能应用程序横幅广告元标记.如果看到此标签,请将其取出:

<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">

After registering a path as a universal link via apple-app-site-association, I'm seeing that on pageloads on iOS safari, when I have the app installed, the system will inject an "open in app" banner on the top of the screen.

I'd like to disable this banner while preserving universal link support for this page. I don't see any official way to do this; is there any method, however hacky or unconventional, to accomplish this?

解决方案

EDIT:

In my answer below, I realized that only loads when the app is not installed. What you are trying to accomplish may not be possible. Since the AASA file is installed on the device, Safari will automatically associate that web page with an app and therefore load the banner in the browser. I don't believe this is an HTML element that you can just remove with a JQuery call. A solution to this would be to use a redirecting link as your Universal Link. This way if the app is installed, the app will open, and if not then it will redirect to your site which isn't recognized as a Universal Link and will not show the banner. Branch is the a solid deep linking solution that uses redirects, so you won't have to deal with the Apple banner.

Removing banner when app is not installed

Make sure the smart app banner meta tag is not being loaded on your page. If you see this tag, take it out:

<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">

这篇关于如何禁用“在应用程序中打开" iOS Safari中的横幅广告是否支持通用链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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