21
Jan
Welcome to the fourth entry on the Progressive Web Application with Django series. In this chapter we will learn how to install our webapp as a native application. Very useful and really easy. Allowing native installation With a small change to the source code, we can ask the user if they want to install our supercool webapp as a "native" app. let beforeInstallPromptEvent = null; let installed = false; async function installPWA() { if (beforeInstallPromptEvent === null || installed) { return; } try { beforeInstallPromptEvent.prompt(); const { outcome } = await beforeInstallPromptEvent.userChoice; if (outcome === 'accepted') { console.log("App install dialog…