title: PWA app beforeInstallPrompt not firing in mobile browser but working in normal desktop browser
body: <p>My case is a bit weird from the rest of the normal PWA installation problems. I audited my code using LightHouse and it gave everything green though I am not able to see the option</p>
  
  <p>"User Can Be Prompted To Install The Web App". </p>
  
  <p>I have written some code in React for my custom prompt for PWA apps. and it goes like this</p>
  
  <p>In App.js file in the componentDidMount method</p>
  
  <p><code></p>
  
  <p>componentDidMount(){</p>
  
  <pre><code>window.addEventListener('beforeinstallprompt',e =&gt;{
    // For older browsers
    e.preventDefault();
    console.log("Install Prompt fired");
  
    this.installPrompt = e;
    // See if the app is already installed, in that case, do nothing
    if((window.matchMedia &amp;&amp; window.matchMedia('(display-mode: standalone)').matches) || window.navigator.standalone === true){
      return false;
    }
    // Set the state variable to make button visible
    this.setState({
      isModalOpen:true
    })
  })
  </code></pre>
  
  <p>}</p>
  
  <p></code></p>
  
  <p>With the state <strong>isModalOpen</strong> I am able to show the custom prompt to the user in normal desktop browser. But when I run the same thing over mobile browser, this beforeinstallprompt is not getting fired. I tried in </p>
  
  <p>Safari Browser in iOS
  Chrome Browser in iOS</p>
  
  <p>Chrome Browser in Android</p>
  
  <p>Can anyone guide me as to what I may be missing. Or if anyone has encountered such issues</p>