baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

iOS Troubles (Works on Android + Web), Subscription never completes #209

Open LynearIngression opened 2 years ago

LynearIngression commented 2 years ago

I'm hoping someone can give me some hints on how to fix this.

cfaSignIn('google.com').subscribe(x => { console.log(x); // <-- nothing here ever executes on iOS });

I have ^3.0.0 somewhat working with google as the provider. I merged changes from the newest RC manually in the swift files, and changed all the imports to firebase/compat/app|auth.

My status:

CapacitorJS for Android + Google - works. CapacitorJS for Android + Facebook - works, Web + Google - works. Web + Facebook - works. CapacitorJS for iOS + Google - doesn't work. CapacitorJS for iOS + Facebook - doesn't work.

I have it working on iOS up to the point of getting the pop-up, as well as seeing the idToken in the console of Xcode. But, it never makes it back to my component.

There are a slew of errors such as 2022-02-01 00:42:05.489881-0800 App[1759:540002] [AXRuntimeCommon] Unknown client: App 2022-02-01 00:42:11.101799-0800 App[1759:539993] [AXRuntimeCommon] AX Lookup problem - errorCode:1100

But I'm not sure these are causing the problem, since I see very similar errors while using a different plugin (ReslearCapacitorGoogleAuth) and that one does work. It's not firebase, it's plain google, but the transport from the call should be similar I think, they both use CAPPlugin, CAPPluginCall. Despite the similar errors I successfully authenticated that idToken, so whatever in capacitor is printing that "TO JS" log does work, sometimes.

I can see the idTokens in the console from the log event, so I think the login is actually happening.

⚡️ TO JS {"providerId":"google.com","idToken":"eyJh......M4a3A

console.log events within cfaSignIn never show up in the log on Xcode, so I think the subscription is never completing. BuildResult resolves the call, but after the TO JS there's nothing in the log.

Any hints?