• H5判断手机是否存在应用和打开应用


    伪命题,其实js无法判断您的手机是否存在此应用,遇到这样的需求我们应该跟ios和Android开发的同事商量,需要他们给你一个url尝试打开,如果能打开就表示手机中有该应用,如果不能打开就表示手机没有这个应用

     //判断是不是ios应用
    if
    (browser.versions.ios) {
                //与ios同事约定好的链接 window.location
    = `com.simpleInteraction.BeeStore://keyId=${keyId}`; setTimeout(function(){
                  //设置计时器如果两秒没有打开就跳转公司官网 window.location.href
    = 'http://www.beestore.io'; },2000)           //判断是不是Android应用 }else if (browser.versions.android){
                //与Android同事约定好的链接 window.location.href
    = `beestore://b11.app/openwith?keyId=${keyId}`; setTimeout(function(){
                  //同理 window.location.href
    = 'http://www.beestore.io'; },2000) }

     打开常用应用

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>打开常用应用</title>
    </head>
    <body>
        <div><a href="weixin://">打开微信</a></div>
        <div><a href="mqq://">打开qq</a></div>
        <div><a href="taobao://">打开淘宝</a></div>
        <div><a href="alipay://">打开支付宝</a></div>
        <div><a href="photos-redirect://">打开照片</a></div>
        <div><a href="itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/search?">打开appstore跳到搜索页</a></div>
        <div><a href="https://itunes.apple.com/cn/app/id477927812">跳转appstore下载百度贴吧页面</a></div>
    </body>
    </html>
  • 相关阅读:
    C#中提供的精准测试程序运行时间的类Stopwatch
    [转]SQLite数据库扫盲
    [转]c# 使用ChartDirector绘图的一些个人体会
    [转]SQLite内存数据库
    SQL Server 各种查询语句执行返回结果
    [转]浅谈 BigInteger
    [转]SQLite数据库连接方式
    ASP.NET 3.5 开发大全DOC版
    好像昨天不见了100块钱。
    热烈庆祝本人昨天终于申请得了google ad
  • 原文地址:https://www.cnblogs.com/ryze/p/ryze15.html
Copyright © 2020-2023  润新知