简体   繁体   中英

Google Signin with Firebase Auth on Android Cordova not working

I spent hours trying to make Google Signin work on Android with Cordova (it was working on iOS / Web). I have followed these instructions: https://firebase.google.com/docs/auth/web/cordova

I was trying to use a custom Dynamic Link ("mydomain.com/link") and it was not working: after authenticating, the user was redirected to the website INSIDE the popup, instead of closing it and authenticate in the app.

So I decided to create a simple "myapp.page.link", but it was not working neither.

Finally, I simply deleted my custom Dynamic Link, and voila, it works!

So you can use a custom domain for the AUTH_DOMAIN , but not for the DYNAMIC_LINK_DOMAIN . Important: if you use a custom AUTH_DOMAIN , you will have to change manually the authDomain attribute in the firebase config of your app.

@Firebase team: I think it could be useful to update the doc to precise that:

  • you cannot use custom Dynamic Link
  • you cannot have several Dynamic Link active

And ideally, it would be ideal to explain how the Dynamic Link is used by Firebase Auth: I followed the explanation, thought that any dynamic link would do the trick, but since you do not explain how it works, it's extremely hard to guess that it is not the case, and that having several dynamic links can be an issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM