打开的iOS,Android和黑莓应用程序常用链接应用程序、常用、链接、黑莓

2023-09-06 13:27:44 作者:七夏.

每个平台都有自己通过URL打开安装的应用程序的方式。

Android有一个可以注册一个URL模式,iOS的可以设置URL方案。

我如何通过邮件发送一个URL,并做出基于链接的网址被点击平台上的iOS和Android打开我的应用程序?

解决方案

您可以编写一个简单的网页来检测一下浏览器的请求来自然后重定向到相应的链接。例如,这里是重定向在PHP 的说明

编辑:

下面是一个code例子。在Android上它确实带来了一个弹出式,并要求用户输入,因为你的Andr​​oid知道它可以打开或者在谷歌播放网页或谷歌Play应用。这是Android上的预期的行为。我还没有尝试过的IPhone,但它不应该导致台式机电脑上弹出。

 < PHP

    如果(preg_match(/.*Android.*/,$ _ SERVER ['HTTP_USER_AGENT'])){
        头('位置:https://play.google.com/store');
    }否则,如果(preg_match(/.*iPhone.*/,$ _ SERVER ['HTTP_USER_AGENT'])){
        头('位置:http://www.apple.com/itunes/whats-on/');
    }

?>
< HTML>

<身体GT;
显示的网页桌面
< /身体GT;
< / HTML>
 
微软将于8月15日发布新版Authenticator应用 统一用户和企业入口

下面是一些其他的解决方案

编辑:

我刚刚注意到,你要打开的程序本身不下载页面的应用程序。在code以上仍然工作。你只需要修复的网址。这两个问题适用

Android的自定义URL中的iOS Launch从Android浏览器 自定义Android应用

Each platform has its own way of opening installed apps via URL.

Android has a URL pattern that can be registered, iOS you can set the URL scheme.

How do I send a single URL via mail and make that link open my app on iOS and Android based on the platform the URL was clicked?

解决方案

You could write a simple web page to detect what browser the request came from and then redirect to the appropriate link. For instance, here is an explanation of redirecting in PHP.

Edit:

Below is a code example. On Android it does bring up a popup and ask for user input because the you Android knows it can open either the Google Play web page or the Google Play app. This is the expected behavior on Android. I haven't tried it on the IPhone, but it shouldn't cause a popup on a desktop computer.

<?php

    if(preg_match ( "/.*Android.*/" , $_SERVER['HTTP_USER_AGENT'])){
        header( 'Location: https://play.google.com/store' ) ;
    } else if (preg_match ( "/.*iPhone.*/" , $_SERVER['HTTP_USER_AGENT'])){
        header( 'location: http://www.apple.com/itunes/whats-on/');
    }

?>
<html>

<body>
Show for web page for desktop
</body>
</html>

Here is a related question with some other solutions

Edit:

I just noticed, you want to open the app itself not the download page for the app. The code above would still work. You just need to fix the url's. These two questions apply

Android Custom URL to open App like in iOS Launch custom android application from android browser