首页 > 移动平台 > 详细

h5唤醒App

时间:2019-12-09 14:27:35      阅读:104      评论:0      收藏:0      [点我收藏+]

一、应用场景

用户在访问我们的网页时,判断出这个用户手机上是否安装了我们的App,如果安装了则直接从网页上打开APP,否则就引导用户前往下载,从而形成一个推广上的闭环。这里只针对从网页端打开本地APP。

二、APP端配置

<activity
    android:name=".ui.activity.ZMCertTestActivity"
    android:label="@string/app_name"
    android:launchMode="singleTask"
    android:screenOrientation="portrait">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:scheme="scheme1"
            android:host="host1"
            android:path="/path1"
            android:port="8080" />
    </intent-filter>
</activity>

WEB端通过调用“scheme1://host1:8080/path1?query1=1&query2=true“便能打开这个Activity。其中scheme和host是必须的,另外的看需求。

三、通过WEB端打开

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
</head>
<body>
    <a href="scheme1://host1:8080/path1?query1=1&query2=true">打开APP</a>
</body>
<html>

 



h5唤醒App

原文:https://www.cnblogs.com/fger/p/12010251.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!