Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation criteria are not met / prompt is undefined #12

Open
Jantjevlith opened this issue Jan 29, 2019 · 12 comments
Open

Installation criteria are not met / prompt is undefined #12

Jantjevlith opened this issue Jan 29, 2019 · 12 comments

Comments

@Jantjevlith
Copy link

Jantjevlith commented Jan 29, 2019

Hi Vincent,

We have made some progress since our last ticket (#11) but unfortunately we haven’t been able to get your demo working.

We did multiple clean installs of ORDS (18.2) on a new server (Windows Server 2016), trying both HTTPS and HTTP. We installed your demo app and followed your guide.

Manifest.json is found

image

Service worker is not found using Chrome (build 71.0.3578.98) but is found using Firefox (64.0.2).

image

image

Continuing on firefox:

If we press the install button (not visible by default so we manually adjusted visibility by editing the HTML/CSS directly). We get the following error-->

image

Also on chrome -->

image

We assume it has something to do with the fact that installation criteria haven’t been met (hence the button being invisible?). But since our service worker is seemingly working, the manifest has been found and we tried both http and https on localhost, we’re running out of ideas.

We haven’t tried using a valid SSL certificate, only self-signed ones, but shouldn’t it be able to work on localhost as that is considered a trusted source? For the sake of being complete, we also adjusted Chrome security flags to see if that helped, which it didn’t.

// This event will be triggered after installation criteria are met
window.addEventListener('beforeinstallprompt', function (event) {
  // Stop the automatic installation prompt
  event.preventDefault();
  // Store the event in a global variable so it can be triggered later
  installPrompt = event;
  // Controls the display (hide and show) of the PWA buttons
  pwa.ui.refresh();
});

If u could help it would be much appreciated

@vincentmorneau
Copy link
Owner

Let's see. Before we go any further, can you please confirm you meet the following criteria:

  • The web app is not already installed
  • Meets a user engagement heuristic (currently, the user has interacted with the domain for at least 30 seconds)
  • Includes a web app manifest that includes:
    • short_name or name
    • icons must include a 192px and a 512px sized icons
    • start_url
    • display must be one of: fullscreen, standalone, or minimal-ui
  • Served over HTTPS (required for service workers)
  • Has registered a service worker with a fetch event handler

@Jantjevlith
Copy link
Author

Jantjevlith commented Feb 1, 2019

  • The web app is not already installed

verified using a mobile device which hasn't been connected before. (using chrome)

  • Meets a user engagement heuristic (currently, the user has interacted with the domain for at least 30 seconds)

done

image-1

Includes a web app manifest that includes:

  • short_name or name
  • icons must include a 192px and a 512px sized icons
  • start_url
  • display must be one of: fullscreen, standalone, or minimal-ui

manifest

screen shot 2019-02-01 at 10 19 39

  • Served over HTTPS (required for service workers)

done

  • Has registered a service worker with a fetch event handler

only in firefox (button didn't appear, manually adjust the css). Chrome fails. For complete story see initial post above.

serviceworker

@pegasoseiya
Copy link

pegasoseiya commented Mar 3, 2019

I HAVE THE SAME TROUBLE Uncaught TypeError: Cannot read property 'prompt' of undefined
at Object.pwa.install (app.js? [sm]:130)
at HTMLButtonElement.onclick (f?p=104:1:::::::59)
and using http without s.

@carlosramirez37
Copy link

I got the same issue later had configured all well some help Plz.
app.js:131 Uncaught TypeError: Cannot read property 'prompt' of undefined
at Object.pwa.install (app.js:131)
at HTMLButtonElement.onclick (f?p=102:1:59)

@VccPlussApexMagic
Copy link

Hello Dudes, i was going along all the steps and configurations, and i received the same issue written here, Cannot read property 'prompt' of undefined at Object.pwa.install (app.js:131) at HTMLButtonElement.onclick (f?p=106:2:59)

@vincentmorneau
Copy link
Owner

I understand that some of you are having problems with the pwa.install function, so I will revisit that part within the next week.

Can you provide the browser you guys are using?

@carlosramirez37
Copy link

carlosramirez37 commented Mar 5, 2019

I understand that some of you are having problems with the pwa.install function, so I will revisit that part within the next week.

Can you provide the browser you guys are using?

THANK you before all, for your time, I'm in the personal using into Chrome Android native version - but also I have tested into firefox beta and not beta and the same issue . even I commented in the app.js the line install //installPrompt.prompt(); prompt to see what it's going on the next I received was userChoice property undefined of the var installPrompt .

@VccPlussApexMagic
Copy link

VccPlussApexMagic commented Mar 5, 2019

I understand that some of you are having problems with the pwa.install function, so I will revisit that part within the next week.
Can you provide the browser you guys are using?

THANK you before all, for your time, I'm in the personal using into Chrome Android native version - but also i have tested into firefox beta and not beta and the same issue . even i commented in the app.js the line install //installPrompt.prompt(); prompt to see what it's going on the next I received was userChoice property undefined of the var installPrompt .

I am not an expert in Js programming but i try to debug where installPrompt var gets the object or similar PWA to have some property, it's would like declare apples having empty the nest, i am trying to debug for this reason appears the object like undefined, but till i don't get where the var takes that object to can have that property PROMT.

Thank you, Also Vincent for your dedication, and looking after our errors . I keep slope also .

\ Also Using Chrome Android -

@pegasoseiya
Copy link

Hi, i am using chrome opera firefox in the mobile phone.

@pegasoseiya
Copy link

pegasoseiya commented Mar 5, 2019

For an error i got this even the manifest.json calls to the http protocol without ssl, i began to have error with ssl later installed glassfish - tomcat - ords , uninstalled re installed an related, , the things ssl stopped working ,when stopped, i try to access the install button and error changed to:

Uncaught TypeError: Cannot read property 'prompt' of undefined
at Object.pwa.install (app.min.js:4)
at HTMLButtonElement.onclick (f?p=104:1:::::::59)

what has in related the ssl ? if I'm not invoking in the json . anyway same prompt property.

@Jantjevlith
Copy link
Author

Jantjevlith commented Apr 1, 2019

I understand that some of you are having problems with the pwa.install function, so I will revisit that part within the next week.

Can you provide the browser you guys are using?

@vincentmorneau : Hi, maybe i missed it but have u already gotten the time to write on this topic?

Tnx for all your efforts.

@vincentmorneau
Copy link
Owner

Unfortunately no. It's still on my list of things to do, but I don't have much free time right now.

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

No branches or pull requests

5 participants