Platform-Specific Install Patterns
You'll learn how install behavior varies across browsers and how to handle these differences gracefully in your PWA.
Why Browser Differences Matter
While the web aims for universality, each browser implements PWA installation differently. Chrome (and Chromium-based browsers like Edge) offer the beforeinstallprompt event you've been using. Safari on iOS uses a completely different approach—users must manually install via the Share menu. Firefox has its own quirks. Understanding these patterns ensures your app provides a good experience everywhere.
Think of it like offering directions to your house: some friends use Google Maps, others use Apple Maps, and a few still prefer written instructions. You need to accommodate all approaches.
Platform-Specific Behaviors
Chrome/Edge (Desktop & Android):
- Supports
beforeinstallpromptevent - Shows mini-infobar automatically
- Custom install buttons work as you've learned
- Install criteria include HTTPS, manifest, and registered service worker
Safari (iOS):
- Does not fire
beforeinstallprompt - Users must tap Share → "Add to Home Screen"
- Your custom install button won't trigger native prompt
- Show instructional UI instead (e.g., "Tap Share icon, then Add to Home Screen")
Safari (macOS):
- Limited PWA support
- Uses File menu → "Add to Dock"
- No programmatic install prompt
Firefox:
- Experimental PWA support varies by platform
- Android version has install capability
- Desktop support is limited
Handling Differences
Detect capabilities, then adapt your UI:
// You already know this pattern from capturing the install event
let deferredPrompt;
window.addEventListener('beforeinstallprompt', (e) => {
deferredPrompt = e;
showInstallButton(); // Browser supports custom prompts
});
// For browsers without the event, show platform-appropriate instructions
if (!deferredPrompt && isIOSSafari()) {
showIOSInstructions();
}
Key Takeaway: PWA installation isn't universal—Chrome/Edge support programmatic prompts, Safari requires manual instructions, so detect capabilities and adapt your UI accordingly for each platform.