Vaadin 14 PWA directly opening in browser on my android phone

Hello friends,

I have one problem with PWA in Vaadin14.

The PWA application works totally fine with desktop.

But when I install the application via install prompt or manually from chrome on my android phone, and open the app I don’t know why? but the application directly opens in browser. Everything works fine like, it appears in my application list, it is installed properly, and there are no errors in console or no exceptions in my application.

It just opens in the browser directly.

I have tried many things such as,
Given the display property in the annotation as standalone, I have tried to create the manifest.json by my own.

But nothing is working. What should I do?

I am totally stuck over here. The weird part is that it is WORKING perfectly on my laptop. But not working on my phone.

Yash Shah:
Hello friends,

I have one problem with PWA in Vaadin14.

The PWA application works totally fine with desktop.

But when I install the application via install prompt or manually from chrome on my android phone, and open the app I don’t know why? but the application directly opens in browser. Everything works fine like, it appears in my application list, it is installed properly, and there are no errors in console or no exceptions in my application.

It just opens in the browser directly.

I have tried many things such as,
Given the display property in the annotation as standalone, I have tried to create the manifest.json by my own.

But nothing is working. What should I do?

I am totally stuck over here. The weird part is that it is WORKING perfectly on my laptop. But not working on my phone.

I am right now in my testing zone. So, I used the help from one of the chrome feature. That is under the chrome://flags and Enabling the flag : “Insecure origins treated as secure”. This flag is used as the alternative of https. So by enabling this I tested the Push Notifications & PWA on my desktop.

Therefore, I don’t think the https as a problem. I mean, I don’t have https right now. Also PWA is working on my laptop and i am able to install it on my phone.

Anyone for help!?

Thanks!

Yash Shah:

Yash Shah:
Hello friends,

I have one problem with PWA in Vaadin14.

The PWA application works totally fine with desktop.

But when I install the application via install prompt or manually from chrome on my android phone, and open the app I don’t know why? but the application directly opens in browser. Everything works fine like, it appears in my application list, it is installed properly, and there are no errors in console or no exceptions in my application.

It just opens in the browser directly.

I have tried many things such as,
Given the display property in the annotation as standalone, I have tried to create the manifest.json by my own.

But nothing is working. What should I do?

I am totally stuck over here. The weird part is that it is WORKING perfectly on my laptop. But not working on my phone.

I am right now in my testing zone. So, I used the help from one of the chrome feature. That is under the chrome://flags and Enabling the flag : “Insecure origins treated as secure”. This flag is used as the alternative of https. So by enabling this I tested the Push Notifications & PWA on my desktop.

Therefore, I don’t think the https as a problem. I mean, I don’t have https right now. Also PWA is working on my laptop and i am able to install it on my phone.

Anyone for help!?

Thanks!

SO, with lots of doubt I tried with SSL certificate to solve the error.

When I ran the spring boot application, I already had 2 applications installed in my phone. So immediately in my mobile google chrome I got the option “Open in Application” from the dropdown from three dots in mobile google chrome. And the application worrked Like charm.

Means, the problem ‘Vaadin PWA directly opens in browser’ is solved.

So, I thought to uninstall the applications and tried to re-install it from the install prompt.

Now!

Here, I got another error. With the SSL certification Https, the service worker is not getting registered and generating the following error in the console.

Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://localhost/') with script ('https://localhost/sw.js'): An SSL certificate error occurred when fetching the script.

Help would be greatly appreciated, Thanks!