3 years ago (2016-01-09)  Algorithm language |   First to comment  2 
post score 0 times, average 0.0

On the mobile-end web pages of JD.com, Baidu.com, etc., there is often a hovering prompt “Click to open the client”. If the user has installed the client on the mobile phone, the client will be automatically invoked to open the client with the same content as the current web page. End page; if the user does not install these apps, the browser will jump to the download site, allowing the user to download the client.This function is also implemented in Wang Baiyuan's blog client. Previously in the "Android implementation to open a specified link to invoke other applications" describes how to automatically invoke the client software if the client clicks on a specific link (APPLINK), and repeat it again here: AndroidManifest in the Activity that you want to jump to when you open the specified link Add an intent-filter tag to the .xml manifest file, and set the scheme, HOST, and other attributes as in the following example.

How to link to the client specified page

by

Category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="wbyblog" android:host="wangbaiyuan.cn" android:pathPrefix="/home"/>

This Intent call Activity can not only start the app when the applink is clicked, but also supports HTTP-like GET pass values. This is the prerequisite for jumping to the web page corresponding to the client page. For example: Wang Baiyuan's blog client registered the android:scheme="wbyblog" android:host="wangbaiyuan.cn" android:pathPrefix="/post" of the Intent's postActivity and opened the link in the browser:"wbyblog://wangbaiyuan .cn/post?postid=1234**&title=Webpage Add Link Call APP and Jump Download Web Site" will add postid:1234** and title: webpage add link call APP and jump download URL to postActivity; In the postActivity implementation of the following code to obtain the incoming value.

This way you can display specific app pages based on pass values.

Web-side implementation installed client is called, no download

On the server side, we need to dynamically generate the APPLINK corresponding to the current page, and display the applink through a floating and fixed div so as to attract users to click.For example, on a mobile phone web page or article page implemented by an extreme guest, a div with the link is generated (the computer does not display it): Blog app auto link call download [ /caption]

The key part is the following js code:

Js enables the browser to open applink to call your app automatically (premise, of course, is that you installed it), and after 1000m jump to the app download page, the other can not determine whether your app is installed on your phone, but The effect is the same!

 

This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/page-add-links-call-app-jump-download-url-2.html

Post comment

Style

No Comment

登录

Forget password?

您也可以使用第三方帐号快捷登录

切换登录

注册

TW