'Launch PWA Add To Home Screen from another app on Android/iOS

I have a somewhat weird question where I don't actually know the correct terminology so if I incorrectly state something please correct me so I can better ask this question. Right now I guess I'm more focused on Android since I have one and can easily emulate and test, but eventually I would like to get it to work on iOS.

Goal: Launch a PWA (Progressive Web App) which was added to the home screen of my device through the A2HS (Add To Home Screen) from another application.

So I currently have two PWA added to my home screen through google chrome, called PWA1 and PWA2. These are URLs that when accessed VIA chrome I can add to my home page through A2HS and when I open it, it functions and looks just like an app.

  • MyApp - Android/iOS app Xamarin
  • PWA1/2 - Progressive Web App added to home screen using Google Chrome's A2HS

I am currently working on another app right now called MyApp, and I would like to know how I can launch my PWA1 and PWA2 from within MyApp. I know I am able to launch other apps installed on my device using PackageManager and intent to launch the app but since these aren't actually real apps I have no idea how to access the ones that are saved to my home screen.

I'm pretty sure I can implement the button on my app opening com.android.chrome but that would just open the chrome app not specifically the PWA on my home screen. So how would I go about doing this?

My first train of thought is that somewhere on the Android OS or in Chrome there is a lookup of the available PWA added to the home screen. If I am able to find that I was hoping there was a way to specify to chrome or the PackageManager that I want to launch com.android.chrome:PWA1 and it will load the one that was added to my home screen.

Any feed back on whether this is possible, or what I should clarify would be greatly appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source