Install pwa in smartphone with localhost
Asked Answered
H

2

5

I have a pwa and with localhost I can install on desktop, but I can't with my samrtphone andorid. Is it possible install a pwa without upload in a http server?

UPDATE: I founded a work around that works, I putted a server on a port on my android smartphone using Dory - node.js (I have installed also express package)

https://play.google.com/store/apps/details?id=io.tempage.dorynode

Opening chrome in that port I see the "add to home screen popup".

Hallucinate answered 9/11, 2018 at 22:46 Comment(4)
I would recommend checking out ngrok.Algae
make sure to meet the criteria for a chrome browserUnhouse
This is my manifest { "name": "PWATEST", "short_name": "pwatest", "icons": [{ some icons .... } ], "start_url": "/index.html", "display": "standalone", "background_color": "#3E4EB8", "theme_color": "#2F3BA2" }Hallucinate
Hi, can you or someone else add more information about what you meant by "I putted a server on a port on my android smartphone using Dory - node.js (I have installed also express package)"? I installed that app on the device but am unclear what to do after installing it and it really doesn't hold your hand at all.Apyretic
A
3

This is unfortunately not an entire solution but an advice on where to look:

  1. Make sure you are in the same wifi network with your Desktop and your phone.
  2. Find out the local IP address of the Desktop PC (probably something like 192.168.0.x). You can find it under ipconfig (Windows) or ifconfig (Unix)
  3. Host your PWA with the http server (remember to use ssl)
  4. Try to access your hosted website from the phones browser, using the IP address and the port, probably something like 192.168.0.x:8080
  5. If you serve your web page through another port (ex. 3000) make sure you configure Port Forwarding through your Router default config IP address

You should be able to open the website. So far I was not able to call the install event, but I will update my answer if I find out more.

Apsis answered 10/11, 2018 at 21:56 Comment(1)
On requesting 192.168.0.x:port, well pwa requires https or localhost, however will still work with 127.0.0.1:port. But on other ips without "cert" https will not work. Thats the issue (without solution)(its a feature 😆)Allard
C
3

It is possible with connecting the mobile phone via USB debugging and enable port forwarding in Google Chrome.

  • Run the dev server on i.e. http://localhost:3000
  • configure port forwarding in Google Chrome for port 3000 and ensure port forwarding is active
  • connect you phone via USB and enable debugging
  • on the mobile open a browser and browse to http://localhost:3000
Cene answered 17/3, 2024 at 22:13 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.