iOS 7 新版微信 URL 不支持跳转 App Store 的解决方案

2019-03-02 00:44|来源: 网路

今天早上刚到公司,就收到反馈说公司前端页面的下载按钮在 iOS 7 的微信内置浏览器里面点击无效,经过确认之后,前端代码是正常的,问题出在了微信上,然后谷歌之,原来腾讯在***。

是 BUG 还是刻意为之?

最新版微信在所有开放的 webview(网页界面)里禁止了通过链接打开本地 app 或跳转到 app store,只有自家使用的 webview 能够打开 app 或跳转 app store。而且这种做法不像是 bug 所致,而是刻意为之。

可能的用意:微信是一个重要的互联网入口和应用入口,但是微信为了自家利益,需要控制入口和流量,进而加强对公共帐号和第三方应用的控制,打击竞争对手

该怎么办呢?

经过讨论之后,我们发现微信内置浏览器右上角的跳转按钮“在 Safari 中打开”可以间接的跳转 App Store ,所以最终我们的解决方案是如果是 iOS 的微信内置浏览器,点击按钮后,用弹出提示的方法来取代直接跳转。

效果如下图所示:

preview

前端实现

index.html

1
2
3
4
5
<div id='popweixin'>  <div class='tip top2bottom animate-delay-1'>  <img src='/static/img/wechat_appstore_popup.jpg'/>  </div> </div> 

app.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#popweixin {  width:100%;  height:100%;  overflow:hidden;  position:fixed;  z-index:1000;  background:rgba(0,0,0,.5);  top:0;  left:0;  display:none; } #popweixin .tip {  width:100%;  background:#fff;  z-index:1001; } .top2bottom {  -webkit-animation:top2bottom 1.2s ease;  -moz-animation:top2bottom 1.2s ease;  -o-animation:top2bottom 1.2s ease;  animation:top2bottom 1.2s ease;  -webkit-animation-fill-mode:backwards;  -moz-animation-fill-mode:backwards;  -o-animation-fill-mode:backwards;  animation-fill-mode:backwards } .animate-delay-1 {  -webkit-animation-delay:1s;  -moz-animation-delay:1s;  -o-animation-delay:1s;  animation-delay:1s } @-webkit-keyframes top2bottom {  0% {  -webkit-transform:translateY(-300px);  opacity:.6 } 100% {  -webkit-transform:translateY(0px);  opacity:1 } }@keyframes top2bottom {  0% {  transform:translateY(-300px);  opacity:.6 } 100% {  transform:translateY(0px);  opacity:1 } 

app.js

1
2
3
4
5
6
7
8
function a(){  var ua = navigator.userAgent.toLowerCase();  if (/iphone|ipod/.test(ua)) {  if(/micromessenger/.test(ua)){  document.getElementById("popweixin").style.display = "block";  }  } } 

转自:http://www.cnblogs.com/zhwl/p/3605369

相关问答

更多
  • 我应该使用用户默认值还是立即开始使用Core Data? 这里有更多的可能性:你也可以使用纯文件或plist,或者使用没有Core Data的sqlite。 答案取决于您计划存储的商品数量: 如果您打算存储1到20个项目,用户默认值可以正常工作 如果您计划存储20到200个项目,则可以使用纯文件或plists 如果您打算存储200多种商品,请根据您对这些技术之一的舒适程度,选择Core Data或sqlite。 Should I go for User Defaults or start with Core ...
  • 一旦你在iTunes连接中创建你的应用程序,你将得到一个应用程序ID。 您可以使用应用ID来引用您的应用,如下所示 http://itunes.apple.com/app/id123456789 其中123456789是您的应用ID 或从您的应用程序中,所以它会打开应用程序商店的应用程序 ITMS-应用://itunes.apple.com/app/id123456789 你可以参考这个问题了解更多细节 Once you create your app in ITunes Connect you will ...
  • 问题是,购买框架包含模拟器(x86_64)和实际设备(ARM)的构建。 当然,您不能向App Store提交二进制文件以支持不支持的架构,因此解决方案是在提交之前手动从最终的二进制文件中删除不需要的体系结构。 Daniel Kennett提出了一个很好的解决方案,并提供了这个脚本来添加到构建阶段: APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" # This script loops through the frameworks embedded in the ...
  • 你好,你可以试试Nick Lockwood的iRate ,看看是否符合你的需求,你可以在这里找到iRate的MonoTouch绑定 。 顺便说一句,它使用以下URL以审查模式打开AppStore: itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type = Purple + Software&id = your-AppID-here 亚历克斯 Hello you could try iRat ...
  • 我终于找到了数字排序字符串问题的答案。 它涉及直接使用块。 对于我的排序描述符,它只是: NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"size" ascending:NO comparator:^(id obj1, id obj2) { return [obj1 compare:obj2 options:NSNumericSearch]; }]; 这允许NSStrings在数字上排序(1,11,2 ...
  • 事实证明,在这种情况下,Xcode给出的错误有点像红色鲱鱼。 在Dropbox完成身份验证后,我正在触发NSNotification ,并且这样做我使用了这个: NSNotificationCenter.defaultCenter().addObserver(self, selector: "dropboxWasLinked:", name: "dropboxLinked", object: nil) ...但我的dropboxWasLinked方法未设置为接收任何参数: func dropboxWasL ...
  • 只要您更新应用程序,即提交新版本,URL就不会更改。 您的应用名称和应用ID将保持不变,因此URL不会更改。 我的网页中有一个链接,链接到应用程序商店中的应用程序,并且已经使用多年,并且我的应用程序的版本很多。 As long as you are updating your app, that is, submitting a new version, the URL won't change. You will have your app name and app ID stay the same th ...
  • 苹果公司在iOS 9.2中进行了更改,旨在推动Universal Links的采用。 你需要实现这些。 最好的选择是使用像Branch.io这样的服务(完全披露:我在分支团队中)或Firebase动态链接。 Apple changed in iOS 9.2 on purpose to drive adoption of Universal Links. You'll need to implement those instead. The best option is to use a service li ...
  • 所以我找到了问题的答案。 当我存档我的应用程序时,我必须选择“iOS设备”,而不是为当时插入的设备进行存档。 资料来源: https : //stackoverflow.com/a/24149087/2053537 So I found the answer to my question. When I archived my app I had to select "iOS Device" and not archiving for a device that's plugged in at the ti ...
  • 使用“itms-apps://”url方案直接在iOS上打开App Store应用程序: 所以你的用例的例子是: ITMS-应用://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search媒体=软件及长期=虚拟现实+ 最简单的测试方法是使用Mac和带有iCloud同步的Notes应用程序。 Use "itms-apps://" url scheme to open the App Store app on iOS directly: So the ...