PWA Template in 2.2

Answered
0
0

Hi I can’t seem to find the PWA template when creating a new project.

  • You must to post comments
Best Answer
1
0

It’s not available yet. Try the attached sample (Wisej.PWA.zip). I’m not sure if it needs a new beta update.

When you run the app you will get this:

Notice the little (+) sign in the address bar. That is chrome’s only notification that you can install the app. Wisej provides a new property Application.CanInstallPWA which lets your app show whatever message you like to the user.

The sample displays the nice bottom panel you see in the screenshot. You can either click the (+) sign on the address bar or click the Install button. When you click the install button the only thing you can do is have a client side event that calls “Wisej.showPWAPrompt()”. That will make the browser show the prompt as if the user clicked the (+) icon.

If the user installs the app it switches to this:

The color of the caption and the icon can be changed in manifest.json. PWA configuration is very picky. Anything wrong and it will fail. You can check using Chrome F12 -> Application -> Workers and Manifest. It will show whatever it is it didn’t like.

After the app is installed, users can run it from their desktop as a desktop app. It will also preload the wisej libraries and cache locally anything it finds in /Offline. If you run the app without a connection you get this:

image

See the different prebuilt Offline-1 to -7. Of course you can put instead anything you like in /Offline. You can put an entire javascript application in there.

 

Attachment
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.