- From: Marcos Cáceres <notifications@github.com>
- Date: Sun, 16 Oct 2016 18:03:03 -0700
- To: w3c/manifest <manifest@noreply.github.com>
Received on Monday, 17 October 2016 01:03:32 UTC
> Note that we still need userChoice on the event, because it is used to tell us about the user's choice when the banner is automatically shown. Good point. If prompt becomes a sync call, then it simplifies things to: ``` window.onbeforeinstallprompt = async function(e) { if (thingsTheUserIsDoingThatBlockInstall.length) { e.preventDefault(); await Promise.all(thingsTheUserIsDoingThatBlockInstall); e.prompt(); } const { userChoice: choice } = await e.userChoice; switch (choice) { case "dismissed": // The user didn't want the app 😢 analytics({ userHatesUs: true }); break; case "accepted": // Awesome! it's installing analytics({ userHatesUs: false }); break; default: console.error(`Unknown choice? ${choice}`); } }; ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/manifest/issues/417#issuecomment-254090538
Received on Monday, 17 October 2016 01:03:32 UTC