I’ve seen the Bubble Forum has a ‘Install to App Screen’ feature, which downloads the app to your Native App screen (I’m on a Galaxy S8, using the Samsung Internet browser).
@emmanuel@josh, any idea how this is achieved? It might help me avoid the anguish and confusion of the app store process.
I’ve actually seen and done that, but what I’m talking about is shown in yellow, a download button in my browser, which triggers the ‘install webapp’ action, which adds it to the actual app drawer (not sure how iPhones work though) and for a popup/notification to prompt the user to install it.
I want to avoid app stores if possible, so this is a possible path I’m exploring.
Well ultimately yes, I guess, but right now I’m just looking for the workflow/element/code that tells the mobile browser to show me the ‘Download’ button (like I’ve circled in yellow in my previous post), or otherwise the steps to show a notification, so when the user clicks a button, the page will be downloaded to their phone. Asking a user to find and click through to the ‘Add to Home’ button on their phones seems like a lot of friction.
I’ve been going through the Add to Home Screen documentation and I’ve got the App Manifest and Service Worker working, icons etc sorted but I’m not sure if that’s it? I don’t get a prompt to install?
I was looking at WebDev but can’t figure out if I need to do the below? And where would I do this in Bubble? In a ‘On page load’ workflow and run Javascript?
If your Progressive Web App meets the required installation criteria, the browser fires a beforeinstallprompt event. Save a reference to the event, and update your user interface to indicate that the user can install your PWA. This is highlighted below.
let deferredPrompt;window.addEventListener('beforeinstallprompt', (e) => { // Prevent the mini-infobar from appearing on mobile e.preventDefault(); // Stash the event so it can be triggered later. deferredPrompt = e; // Update UI notify the user they can install the PWA showInstallPromotion();});
Sorry, this isn’t something I’ve done, just pointing you to the most official documentation for it.
As far as where to execute such code, you’d either do that in a plugin or use an HTML element, or use the custom header feature to add a script that adds the EventListener function you need.