PWA Questions

Some questions on PWA.

  1. Is there anyway to show a button to install the PWA, Save to Home Screen is a bit esoteric.
  2. I am assuming that IndexDB will work for PWA storage, while it is offline.
  3. I need to store non-DB info as well. Does the cookie/session still work? Is there any support in TMS Webcore for it?
  4. Are the form html files and css file part of the js. Or can I just change them individually, without compiling the PWA?
  5. When compiling as Release, the js is obfuscated by default. Are there any other differences? Is there extra code in Debug, that is perhaps removed in Release?
  6. Does the PWA have access to files? I need to create a csv and/or a pdf and email it.
  1. I think on Android you can add a button but on iOS all you can do is give them a note to say that they should install it. You can't trigger the action directly. You can tell if it is running from the home screen though and then hide the note.
  2. I think so.
  3. localStorage works great.
  4. Dunno. I think they are separate.
  5. Code that isn't called by Delphi (only by JavaScript) might get optimized out of the app, so be mindful of that. There are also differences with map files if you use those - the Release I think leaves them out.
  6. Not sure what you're after here? You can create out of thin air a CSV file or a PDF file and send it from within TMS WEB Core using a helper library to do the mailing part. You can also access other web server files (or files that have been copied over by the service worker if running offline).

Can the PWA tell if its running as a PWA, or if its running in the full-blown browser?

I am thinking that If I show instructions to install. As soon as they have installed, I want to hide those instructions.

Yes, I believe so. It's been a while since I looked at this, but there are some things you can check. I don't recall how well it works in different browsers, but you can search around and find a few tidbits. Here's one. Detection  |  web.dev

1 Like