簡體   English   中英

Android Web App僅適用於某些設備

[英]Android Web App working only on some devices

我有一個可控制Raspberry上某些功能的webapp,但我在所有android設備上都無法識別它。 該網站服務器是具有Apache的Raspberry Pi 3(均為最新版本)。

出於隱私/安全原因,所有IP地址都用簡單的000.000.000.000進行了更改

我可以通過Chrome中的“添加到家”選項輕松地將webapp添加到我的Samsung S7中,並且運行流暢,但是,在我所有其他家族的Android(和iOS)設備上也沒有,僅將其添加為指向家。

這是在我的S7上顯示的方式: Web 應用程序內的 主屏幕(獲取圖標)

這是manifest.json代碼:

{
  "name": "Casa TAM Domotica",
  "short_name": "CasaControl",
  "theme_color": "#008eff",
  "background_color": "#085491",
  "display": "standalone",
  "orientation": "portrait",
  "start_url": "000.000.000.000",
  "icons": [
    {
      "src": "images/icons/icon-72x72.png",
      "sizes": "72x72",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-384x384.png",
      "sizes": "384x384",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ],
  "splash_pages": null
}

這是index.php代碼:

<?php

$c=$_GET['c'];
$r=$_GET['r'];
$g=$_GET['g'];
$b=$_GET['b'];


/* after every raspberry pi reboot it must execute pigpiod*/
$execute = shell_exec("pigpiod");

if($c == 1)
{
        $execute = shell_exec("pigpiod");
        $execute = shell_exec("pigs w 12 0");
        sleep(1);
        $execute = shell_exec("pigs w 12 1");
    header('Location: 000.000.000.000');
}

if($r != "" AND $g != "" AND $b != "")
{
        $execute = shell_exec("pigpiod");
        $execute = shell_exec("pigs p 22 $r");
        $execute = shell_exec("pigs p 27 $g");
    $execute = shell_exec("pigs p 17 $b");
        header('Location: 000.000.000.000');
}


?>

<!DOCTYPE html>
<html lang="en">
<body bgcolor="#000000">
<head>
<body scroll="no" style="overflow: hidden">
<meta name="viewport">
<meta name="mobile-web-app-capable" content="yes">
<style>
.button {
    background-color: #e7e7e7;
    border: none;
    color: white;
    padding: 20px 50px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 24px;
    margin: 1px 1px;
    cursor: pointer;
    width: 100%;
    color: black;
    font-family: Arial, Helvetica, sans-serif;
}

.button0 {
        background-color: #e7e7e7;
        border: none;
        color: white;
        padding: 50px;
        display: inline-block;
}


.buttonblu {background-color: #008CBA;}
.buttonrosso {background-color: #f44336;}
.buttonverde {background-color: #4CAF50;}
.buttonviola {background-color: #896D93;}
.buttonarancione {background-color: #FFA500;}
.buttongiallo {background-color: #FFFF00;}
.buttonrosa {background-color: #FEB5B5;}
.buttonbianco {background-color: #FFFFFF;}


</style>
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="manifest" href="manifest.json">
    <link rel="icon" href="ico.ico">
        <meta charset="utf-8" />
        <title>Apertura cancello TAM</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script>
        function show(id) {
                if(document.getElementById) {
                        var mydiv = document.getElementById(id);
                        mydiv.style.display = (mydiv.style.display=='block'?'none':'block');
                }
        }
        </script>
        <style>
                body {
                        width:50%;
                        padding-top:5%;
                        margin:auto;
                }
        </style>
</head>
<body>
<p>
<center><a href="index.php?c=1"  class="button"><font size="100">Apertura Cancello</font></a></center>

<a href="index.php?r=0&g=140&b=186"  class="button0 buttonblu"></a>
<a href="index.php?r=244&g=67&b=54"  class="button0 buttonrosso"></a>
<a href="index.php?r=76&g=175&b=80"  class="button0 buttonverde"></a>
<a href="index.php?r=137&g=109&b=147"  class="button0 buttonviola"></a>
<a href="index.php?r=255&g=165&b=0"  class="button0 buttonarancione"></a>
<a href="index.php?r=255&g=255&b=0"  class="button0 buttongiallo"></a>
<a href="index.php?r=254&g=181&b=181"  class="button0 buttonrosa"></a>
<a href="index.php?r=155&g=155&b=155"  class="button0 buttonbianco"></a>
</p>
<IFRAME src="000.000.000.000/cam_pic_new.php" align="center" width="1080" height="810" scrolling="no" frameborder=0 marginheight="0px"</IFRAME>

有什么辦法嗎?

修復它,manifest.json並不總是被系統讀取,我添加了更多的實例

<link rel="manifest" href="manifest.json">

解決問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM