Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open external links in webview as default in IOS PWA

I'm testing Progressive Web App in IOS 11.3.

My pwa has a Facebook social login button that, when clicked, points to an external link (different windows.location).

The problem is that the pwa opens safari app to show external links instead of using a webview within the pwa. So, when the login is done, you will not be redirected to the pwa, but remains in safari.

I tried following examples like this one: https://gist.github.com/kylebarrow/1042026 but seems not working

How can I force the pwa to open external links in a webview?

Thanks in advance

like image 713
Enricosoft Avatar asked May 24 '18 07:05

Enricosoft


Video Answer


2 Answers

Use BUTTON instead of A tag and set onclick with window.location.href = 'yourUrl' It seems to working well

like image 115
Enricosoft Avatar answered Nov 07 '22 07:11

Enricosoft


If you use SSR (Server Side Rendering) and your PWA is not static, you should follow App Shell concept. So every time when you click external link, it should be fetched and inserted in your dynamic section. Link: https://developers.google.com/web/updates/2015/11/app-shell

like image 36
Oleg Avatar answered Nov 07 '22 08:11

Oleg