Nate
Nate

Reputation: 361

PWA - is it possible to open a native app from a PWA?

I have a native app (requires functionality of a native app) but my site is now a PWA. Is there a way I can open my native app via a button in my PWA?

Upvotes: 4

Views: 2424

Answers (2)

Ali Rezaei
Ali Rezaei

Reputation: 1

this works for Android:

document.location.href = `google.navigation://?q=${lat},${lon}`;

Upvotes: 0

Yes, you can open native app via PWA. However, there will be no data connection between your native app and PWA.

In your PWA side, you just need to execute the code below when the button is clicked.

For iOS:

document.location.href = 'your_app_schemes_url://';

For Android:

document.location.href = 'intent:#Intent;scheme=app_scheme;package=app_package;end;';

Upvotes: 5

Related Questions