2017-10-29 2 views
0

Ich habe eine Webapp, die einige Funktionen auf meinem Raspberry steuert, aber ich habe Probleme, als solche von allen meinen Android-Geräten erkannt. Der Website-Server ist ein Raspberry Pi 3 mit Apache (alles auf dem neuesten Stand).Android Web App funktioniert nur auf einigen Geräten

die alle IP-Adressen werden mit einem einfachen 000.000.000.000 für die Privatsphäre/Sicherheitsgründen geändert

Ich kann die Webapp zu meinem Samsung S7 über den „add to home“ Option in Chrome und es funktioniert reibungslos leicht hinzufügen, aber , auf all meinen anderen Android-Geräten (und auch auf iOS-Geräten) funktioniert es nicht, es wird einfach als Link zum Home hinzugefügt.

Dies ist, wie es auf meinem S7 gezeigt ist: homescreen (it gets the icon) inside the webapp

manifest.json Dies ist der Code:

{ 
    "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 
} 

Dies ist der index.php Code:

<?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> 

Irgendeine Lösung?

Antwort

0

Fest es wurde die manifest.json nicht immer vom System gelesen, fügte ich mehr Instanzen von

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

das Problem zu beheben

Verwandte Themen