• Resolved Bjarne Oldrup

    (@oldrup)


    Just curious.

    I can detect whether site is being displayed on iOS, Android and more.

    That means, I can provide specific help on how to install the website on a phone or tablet as a Progressive Web App or PWA. The procedure is slightly different on iPhones and Android phones.

    Do you think it would be possible to detect, whether the site is already installed and running as a PWA? Hiding the instructions on how to install, once it’s already installed?

    That would clean up the landing page even further.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hmm, this is a great question, but I don’t think so. From the little research I have done, you need to detect PWAs with JavaScript and all the visibility checks in Block Visibility are run using PHP.

    If anyone reading this has a technical solution, I would be all ears, but for now the answer unfortunately is no. Sorry about that!

    Best,
    Nick

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Oh, it wasn’t hard at all, it appeared. Query Strings to the rescue!

    The SuperPWA plugin I use, has an option to add a UTM Campaign query string to the start page (home page of the web app). It looks something like this:

    /?utm_source=pwa&utm_medium=pwa&utm_campaign=pwa

    That’s useful for tracking how many install the PWA, and while being added only to the start page, that’s where I want to display the block conditionally.

    So the solution for me, is to utilize block visibility fine query string visibility control and boom.

    Worked on the first attempt. Almost too easy, @ndiego ??

    Plugin Author Nick Diego

    (@ndiego)

    So the solution for me, is to utilize block visibility fine?query string visibility control?and boom.

    Worked on the first attempt. Almost too easy, @ndiego ??

    Awesome, glad you found a solution! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Option to detect if running as PWA (progressive web app)?’ is closed to new replies.