EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

login() promise for Apple Sign In is not resolved or rejected #1512

Closed tkrevh closed 4 years ago

tkrevh commented 4 years ago

TNS Android 6.2.0, nativescript-plugin-firebase@10.3.1

Trying Apple Sign in, in its simplest form:

     firebase.login({type: firebase.LoginType.APPLE})
          .then(
               result => console.log('result=', JSON.stringify(result)),
               error => console.log('error=', error)
          ).catch(e => console.log('e=', e))

It opens up a browser with apple sign in, asks for apple id and password, proceeds to confirmation screen "Do you want to continue using AppName with your Apple ID email@email.com?" After tapping on continue there is some processing for about 0.5sec, then the browser closes and promise doesn't resolve or reject.

Any ideas what could be wrong?

In case it is important - Google Auth works normally.

tkrevh commented 4 years ago

Could it be, that this line is missing a resolve? resolve(toLoginResult(authResult.getUser(), authResult.getAdditionalUserInfo()));

Submitted a PR for this issue:

tkrevh commented 4 years ago

Same problem occurs also on iOS. After the Apple login/signup dialog disappears, neither resolve or reject of Promise is called. (edit: sometimes the resolve or reject is called, but I can not tell what triggers it - by adding some logging into js code, I could see that when it doesn't work the authorizationControllerDidCompleteWithAuthorization method is not called) Any way to get this fixed please @EddyVerbruggen? Or ideas/workarounds?

tkrevh commented 4 years ago

Ahhh... Spent 2 days on this iOS issue. Tried everything, to no avail. Sometimes the promise wasn't resolved / delegate method authorizationControllerDidCompleteWithAuthorization wasn't invoked. Then finally I started suspecting garbage collection. And after some tinkering and googling, I ran across this issue.

I've submitted a PR for this. Can you please include this PR and release a new version? It is currently blocking new app submission to Apple App Store. Thank you @EddyVerbruggen 🥇

EddyVerbruggen commented 4 years ago

Absolutely, thank you!

tkrevh commented 4 years ago

You're the best, thank you for such quick response and release 🥇 Now keeping fingers crossed for apple app review...