Skip to content

Add PWA install button for Android users to increase adoption#2504

Open
jstarner wants to merge 5 commits intobasecamp:mainfrom
jstarner:pwa-install-button
Open

Add PWA install button for Android users to increase adoption#2504
jstarner wants to merge 5 commits intobasecamp:mainfrom
jstarner:pwa-install-button

Conversation

@jstarner
Copy link
Contributor

@jstarner jstarner commented Feb 6, 2026

Summary

This PR adds a PWA install button to the user settings menu, specifically targeting Android Chrome users. It leverages the beforeinstallprompt event to detect installation eligibility and implements the richer PWA installation UI

fizzy-pwa Screenshot_20260206-160901

Key Changes

  • PWA Install Button: Added a new "Install Fizzy App" item to the settings menu (app/views/my/menus/_settings.html.erb).
  • Stimulus Controller: Created pwa_install_controller.js to manage the installation flow, listen for availability events, and toggle visibility of the install button.
  • JS Initializer: Added app/javascript/initializers/pwa_install.js to capture the beforeinstallprompt event and store the deferred prompt for later use.
  • Manifest Screenshots: Updated manifest.json.erb with high-quality screenshots of the Activity Feed, Project Board, and Card Details to enhance the "Rich Install" experience on supported platforms.

Test Plan

  1. Android/Chrome:
    • Open Fizzy in Chrome on an Android device.
    • Navigate to the Settings menu.
    • Verify the "Install Fizzy App" button appears.
    • Click the button and confirm the native installation prompt is shown.
    • After installation, verify the button is no longer visible in the standalone app.
  2. Desktop/Other Browsers:
    • Verify the button remains hidden on platforms where the native install prompt is not supported or captured.
  3. Standalone Mode:
    • Open the app as a PWA and verify the install button is hidden.

<%= filter_place_menu_item notifications_settings_path, "Notification Settings", "settings" %>

<%= tag.li class: "popup__item", hidden: true, data: { controller: "pwa-install", filter_target: "item", navigable_list_target: "item" } do %>
<%= icon_tag "install-edge", class: "popup__icon" %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder icon for now, will likely want to use something else. Possibly something like https://www.shadcn.io/icon/mdi-cellphone-arrow-down-variant

"purpose": "maskable"
}
],
"screenshots": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are needed to add support for rich PWA install flow: https://developer.chrome.com/blog/richer-pwa-installation

These are placeholders for now, will need proper examples if ya'll want to support this rich UI

@@ -0,0 +1,9 @@
window.addEventListener("beforeinstallprompt", (e) => {
const ua = navigator.userAgent
if (!(/Android/i.test(ua) && /Chrome/i.test(ua))) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS does not support calling the install prompt, and from what I can tell it only works in Chrome on Android. Don't think it's necessary for Desktop users as mobile seems like the main target audience.

<%= tag.li class: "popup__item hidden", data: { controller: "pwa-install", filter_target: "item", navigable_list_target: "item" } do %>
<%= icon_tag "install-edge", class: "popup__icon" %>
<button class="popup__btn btn" data-action="pwa-install#install" data-pwa-install-target="button">
<span>Install Fizzy App</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want some different copy for this, just what I came up with 💁‍♂️

@jstarner jstarner marked this pull request as ready for review February 6, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant