Progressive Web Application (PWA) Offline OAuth Error

After I saved your PWA (test application), built with the help of Create React Appon the desktop and run the application in a mode standaloneon android using Chrome and iOS using Safari, then in Annex I initiate method Firebase signInWithPopup(GoogleProvider), the device asks me if I want to I open the action with the help Test Appor other browsers installed on the device, ie chrome, firefox. If I open with my Test Apppopup, and I select the correct Google account.

Error: . After choosing a google account, the popup closes without redirecting it back to mine Test App.

If instead I open the Firebase method signInWithPopup(GoogleProvider)with a browser chrome, and not mine Test App, a popup will open to select a google account, and after I select a google account, the popup will close and redirect back to Test Appinstantly, and then

Error: it goes back to the tab chromewhere the google account is requested, which displays the download indicator, and just hangs there.

There are no console errors or warnings that appear.

Note 1: The error of a pop-up window that does not close and stays on loading also occurs if I add the application to the desktop on the machine Windows 10 x64using Version 64.0.3259.0 (Official Build) canary (64-bit)and run it as a standalone window.

Note 2: An error also occurs for signInWithPopup(Facebookprovider)and signInWithPopup(Twitterprovider) . Also, if I remove the application from Homescreen and run only in the browser, then signing in the OAuth stream works fine.

3: , , OAuth. i.e , , Test App Facebook, , . , google, OAuth , , . google, , . Twitter OAuth, , twitter Authorize App .

: , - google chrome OAuth Webview.

GIf Windows: , twitter auth , , google facebook OAuth.

enter image description here

+4
3

Google:

https://firebase.google.com/docs/auth/web/google-signin

Firebase Google. Google, . .

, 2 :

  • firebase.auth(). SignInWithPopup ()
  • firebase.auth(). SignInWithRedirect ()

, .

, : , ?

:

  if ( isInMobileDevice) {

   firebase.auth().getRedirectResult().then(function(result) { .... }

  }
  else {

  firebase.auth().signInWithPopup(provider).then(function(result) { .... }
}

, (true/false) "isInMobileDevice"

+1

"display: standalone", ,

function isRunningStandalone() {
    return (window.matchMedia('(display-mode: standalone)').matches);
}
...
if (isRunningStandalone()) {
    /* This code will be executed if app is running standalone */
}
0
0
source

Source: https://habr.com/ru/post/1688757/


All Articles