简体   繁体   English

如何在 web 表格中找到手机应用程序的 ID/程序名称?

[英]How to find the ID / Program name of a phone app application in web form?

What I am doing我在做什么

I am creating a web form that is being used as a QR code to open an application installed in an android / IOS phone.我正在创建一个 web 表单,该表单用作 QR 码以打开安装在 android / IOS 手机中的应用程序。 When the user scans the QR code the phone shall run the web form and the web form will check if the application is installed inside the phone, if the application is installed, the web form will open the application, if not it will open the google play store/app store web page based on which OS system is being used.用户扫描二维码时手机会运行web表格,web表格会检查手机内是否安装了应用程序,如果安装了应用程序,Z2567A5EC9705EB7AC2C984033E0619将打开应用程序播放商店/应用商店 web 页面基于正在使用的操作系统。

My problem我的问题

Right now my problem is that I do not know what is the name/id of the application to trigger/open it, the only thing I about the app know is that it is called Rymtime inside the setting and also the home screen.现在我的问题是我不知道触发/打开它的应用程序的名称/ID是什么,我唯一知道的是它在设置和主屏幕中被称为Rymtime。 The application's google play store link is at here and here for the app store.该应用程序的 google play 商店链接位于应用商店的此处此处

PS. PS。 I do not own/create the application and do not have any access to modify its code.我不拥有/创建应用程序,也无权修改其代码。

在此处输入图像描述

What I have tried我试过的

I have tried to put its name directly into the code:我试图将其名称直接放入代码中:

window.location = "Rymtime://";

I have also tried to put the "id" thingy found inside its google play store website "www...id=com.time2clock.wai.timeemployee"我还尝试将在其 google play 商店网站“www...id=com.time2clock.wai.timeemployee”中找到的“id”东西放在

window.location = "com.time2clock.wai.timeemployee://";

My Code我的代码

I created my code based on this stack overflow question.我根据这个堆栈溢出问题创建了我的代码。

Below is my code:下面是我的代码:

<body>
...
            <button name="data1" type="button" onclick="getOS()">Click</button> //I use button to test out the function
...
</body>
     
<script type="text/javascript">
         function getOS() {
             var userAgent = window.navigator.userAgent,
                 platform = window.navigator.platform,
                 windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'], //as I do not own an Iphone I use this to test out the IOS part
                 iosPlatforms = ['iPhone', 'iPad', 'iPod'],
                 os = null;
             if (iosPlatforms.indexOf(platform) !== -1) {
                 ios();
             } else if (windowsPlatforms.indexOf(platform) !== -1) {
                 ios(); //as I do not own an Iphone I use this to test out the IOS part
             } else if (/Android/.test(userAgent)) {
                 android();
             }
    }
    function ios() {
        setTimeout(function () { window.location = "https://apps.apple.com/my/app/rymtime/id1447217174"; }, 25);
        window.location = "Rymtime://"; //I do not test this part because I do not own an Iphone an I am using window to see if the code is being executed, I only check if the website above is runned
    }
         function android() {
             setTimeout(function () { window.location = "https://play.google.com/store/apps/details?id=com.time2clock.wai.timeemployee"; }, 25);
             window.location = "Rymtime://"; //The application is not executed thus it redirect to the play store page.
             }
</script>

Btw is the location of an application installed inside a phone the same as the others?顺便说一句,安装在手机中的应用程序的位置与其他应用程序的位置相同吗? Like this:像这样:

somefile\somefile\packageName

Or something like this:或者是这样的:

Username(differ)\somefile\somefile\packageName

Thanks.谢谢。

I am not sure what it is for IOS but I found out that I can just add &launch=true at the end of the URL of the application's google play store page to launch the app if it is installed.我不确定 IOS 是什么,但我发现我可以在应用程序的 google play 商店页面的 URL 的末尾添加&launch=true来启动应用程序(如果已安装)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM