dwyl / dwyl/PWA-Liveview

User Agent detection and Android/Chromium flow

Open
#41 2 comments 0 reactions 1 assignee Claimed by @ndrean View on GitHub
documentation enhancement
Dominant language
JavaScript
Stars
33
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Source:
-
-

Why?
- to propose in the UI a button "install PWA" when the user agent is Android/Chromium based for an easy setup
- no such thing on iPhone because iOS does not support `beforeinstallprompt` and uses a different flow

Two ways to detect User Agent against a database:
- JavaScript library: [ua-parser-js](https://github.com/faisalman/ua-parser-js)
- Elixir library: [ua_parser](https://github.com/beam-community/ua_parser)

If you use the Elixir library, you must setup:
- a `Plug` to read from the `conn` on the first HTTP pass of the LiveView,
- or use it in the LiveView `mount`or `on_mount` after adding `:user_agent` to the `:connect_info`. Check and .

❓ Browser flow or server flow? With the browser flow, you have more JS to load, 10kB...

Firstyl, let's check `bundlephobia.com`:

Then implement server-side and check

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.