Reputation: 361
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
Reputation: 1
this works for Android:
document.location.href = `google.navigation://?q=${lat},${lon}`;
Upvotes: 0
Reputation: 79
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