Hi.
I have downloaded a PWA sample (WisejPWAWebApplication1) from the forum and it worked perfectly:
https://wisej.com/support/question/wisej-2-2-example-pwa
I am now trying to turn a solution that wasn’t been created with the PWA Template into a PWA allowed application.
I have copied the Offline folder to my application folder.
Copied the manifest.json to the same folder.
Edited my Default.json and added:
"enablePWA": true,
"offlineUrl": "Offline/Default.html",
Edited my Default.html and added (didn’t type the “less than” and “greater than” signs bellow as it keeps the line from displaying here):
link rel="manifest" href="manifest.json"
In my Program.cs:
In Main():
Application.BeforeInstallPrompt += Application_BeforeInstallPrompt;
Also in Program.cs:
private static void Application_BeforeInstallPrompt(object sender, EventArgs e)
{
Application.BeforeInstallPrompt -= Application_BeforeInstallPrompt;
}
However, Application_BeforeInstallPrompt is never called and I also don’t get the indicator in the Chrome browser Navigation bar allowing to “Install App”. This all works fine in the sample when I run it.
When I run my application, I open the browser Console and can’t see any complaints there.
Would there be anything else I should pay attention to?
Thanks in advance.
Ivan
(Wisej 2.2.51.0 – VS 2019 – C#)
Hi Ivan
Thanks very much for sharing your solution 🙂
Regards and happy coding
I went ahead and called from my application menu: this.Eval(“Wisej.showPWAPrompt()”);
Got an error in the browser Console:
Failed to load resource: the server responded with a status of 403 (Forbidden) manifest.json:1
Found it! 🙂
In the application Web.config, there was an entry for the handlers:
add name="json" verb="*" path="*.json" type="System.Web.HttpForbiddenHandler"/
In the working sample, instead of seting to all .json files, it states only Default.json. So, changing the Web.config like bellow fixed it:
add name="json" verb="*" path="Default.json" type="System.Web.HttpForbiddenHandler"/
Please login first to submit.