Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Sites with PWAs showing "Add to home screen" instead of "Install" on Samsung S8 and N9 #9692

Closed
kbrosnan opened this issue Apr 3, 2020 · 8 comments
Assignees
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified Feature:PWA Progressive Web App needs:investigation P2 Upcoming release

Comments

@kbrosnan
Copy link
Contributor

kbrosnan commented Apr 3, 2020

Steps to reproduce

  • Using a Galaxy S8 [SM-G950U1] or Galaxy Note 9 [SM-N960U1] visit
  • app.starbucks.com
  • 9gag.com
  • trivago.com
  • pinterest.com
  • twitter.com
  • tap on the 3 dot menu
  • look for Install option

Expected behavior

  • Install option present

Actual behavior

  • Add to home screen offered

Device information

  • Android device: See above
  • Fenix version: 4.2.1

┆Issue is synchronized with this Jira Task

@kbrosnan kbrosnan added 🐞 bug Crashes, Something isn't working, .. Feature:PWA Progressive Web App needs:group-triage labels Apr 3, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Apr 3, 2020
@boek boek added P2 Upcoming release and removed needs:group-triage needs:triage Issue needs triage labels Apr 7, 2020
@sblatz
Copy link
Contributor

sblatz commented Apr 7, 2020

After discussing this in triage, it seems like what's happening is the language is wrong but it's properly installing the PWA (at least on twitter with Galaxy S9).

Let's investigate why it's intermittently showing the wrong text (sometimes we're seeing install, sometimes "add to homescreen" even on the same device & site after a refresh)

@sblatz
Copy link
Contributor

sblatz commented Apr 7, 2020

@rocketsroger may have some more insights here but we can discuss during AC sprint planning.

@kbrosnan kbrosnan changed the title [Bug] PWA not able to be installed on Samsung S8 and N9 [Bug] Sites with PWAs showing "Add to home screen" instead of "Install" on Samsung S8 and N9 Apr 7, 2020
@ekager
Copy link
Contributor

ekager commented Apr 9, 2020

I figured out what is happening here and it's a Fenix bug:
The "label" of the menu item either reads "Add to homescreen" or "Install" based on if it's a PWA.

It will only read as "Install" if this item is hightlighted.

if (shouldShowAddToHomescreen() && addToHomescreen.isHighlighted()) {
lowPrioHighlightItems.add(ToolbarMenu.Item.AddToHomeScreen)
}

But it will only be highlighted if this is true. But installPwaOpened is only true the first time a user opens the menu and sees the highlight for an "install-able" page.

isHighlighted = {
val webAppUseCases = context.components.useCases.webAppUseCases
webAppUseCases.isPinningSupported() &&
webAppUseCases.isInstallable() &&
!context.settings().installPwaOpened

This was a fairly recent regression added in PR #8805 for #8800

@ekager ekager self-assigned this Apr 9, 2020
ekager added a commit to ekager/fenix that referenced this issue Apr 9, 2020
ekager added a commit to ekager/fenix that referenced this issue Apr 11, 2020
ekager added a commit to ekager/fenix that referenced this issue Apr 11, 2020
@serovar
Copy link

serovar commented Apr 11, 2020

I don't know if it is related, but on my Pixel 2 XL feedbin.com shows "Add to home screen" instead of "Install" even if you can install it as a PWA with Chrome.

ekager added a commit to ekager/fenix that referenced this issue Apr 13, 2020
@ekager ekager added the eng:qa:needed QA Needed label Apr 13, 2020
@ekager
Copy link
Contributor

ekager commented Apr 13, 2020

@serovar definitely related! The fix I just landed should be in the next Nightly, but for now if you click "Add to homescreen" for an installable PWA will still install it as a PWA. :)

@serovar
Copy link

serovar commented Apr 13, 2020

Maybe it is not related then, since if I tap it, it adds a shortcut on my home screen, that simply opens a new tab on Fenix (while it opens properly borderless if I add it to the home screen with Chrome). I will open a new issue when I have the time, thanks for clarifying :)

@ekager
Copy link
Contributor

ekager commented Apr 13, 2020

@serovar yes if you could open a new issue with what app you're trying to install that would be great. Thanks!

@liuche liuche mentioned this issue Apr 13, 2020
32 tasks
@AndiAJ
Copy link
Collaborator

AndiAJ commented Apr 14, 2020

Hi @ekager , I've just checked this matter on both Debug build from Master and Fenix beta 4.3.0-beta.1 (Build #21050021) using the following devices:
• Google Pixel 3a (Android 10)
• Huawei Mate 20 Lite (Android 9)
• OnePlus A3 (Android 6.0.1)

✔️ Debug build from Master 4/14
• Works properly

► Video
20200414-133338

❌ Fenix Beta - behind a feature flag
•"Add to home screen" is still displayed over the "Install" button
• It adds after the second attempt a shortcut (opened a while ago #9049 )

► Video
20200414-120456

Considering that its fixed on Nightly and due to the fact that it's behind a feature flag which makes it unavailable on Beta 4.3.0 I'll mark this verified as fixed

@AndiAJ AndiAJ added eng:qa:verified QA Verified and removed eng:qa:needed QA Needed labels Apr 14, 2020
@AndiAJ AndiAJ closed this as completed Apr 14, 2020
@liuche liuche mentioned this issue Apr 28, 2020
32 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified Feature:PWA Progressive Web App needs:investigation P2 Upcoming release
Projects
None yet
Development

No branches or pull requests

6 participants