baumblatt / capacitor-firebase-auth

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

Update this plugin for Capacitor 3 #136

Open joseph-navant opened 3 years ago

joseph-navant commented 3 years ago

Capacitor 3 is being built and is already in beta. In this new version the native plugins have been removed from the core and there are some changes that are necessary in the existing plugins.

Example: Plugin Imports The Plugins object is deprecated, but will continue to work in Capacitor 3. Capacitor plugins should be updated to use the new plugin registration APIs (see the Upgrade Guide for plugins), which will allow them to be imported directly from the plugin’s package.

Going forward, the Plugins object from @capacitor/core should not be used.

// OLD
import { Plugins } from '@capacitor/core';
const { AnyPlugin } = Plugins;
Importing the plugin directly from the plugin’s package is preferred, but the plugin must be updated to work with Capacitor 3 for this to be possible.
// NEW
import { AnyPlugin } from 'any-plugin';

References:

Updating Capacitor to 3.0 in your plugin

Updating Capacitor to 3.0 in your app

(credits to @mklipe for issue explanation)

mesqueeb commented 3 years ago

@joseph-navant this is a very welcome change and would love to be able to update to Capacitor v3.0 with @baumblatt's prominent capacitor-firebase-auth! <3

JoshuvaGeorge03 commented 3 years ago

Looking forward to capacitor 3 supported capacitor-firebase-auth. Thanks,

lincolnthree commented 3 years ago

If you need this working ASAP, here's my fork which is updated to work with Capacitor 3. It's a bit too messy to send a PR, but will be opening an issue to discuss:

https://github.com/lincolnthree/capacitor-firebase-auth

You can try it by including this repository in your package.json directly instead of specifying a version:

"dependencies": { "capacitor-firebase-auth": "lincolnthree/capacitor-firebase-auth" }

lincolnthree commented 3 years ago

Pull request: https://github.com/baumblatt/capacitor-firebase-auth/pull/146

gillarf commented 3 years ago

I'd love to have this working for Capacitor 3. I will try your fork @lincolnthree

baumblatt commented 3 years ago

Hello,

The job made by @lincolnthree can be previewed on release candidate v3.0.0-rc.0 on future tag.

As soon as we hearing the tests result the working is promoted to tag next.

Please, help us testing this before the final release that is waiting of Capacitorjs equivalent release.

Best regards

baptisteArno commented 3 years ago

I confirm Google and Apple Sign In are working on iOS with v3.0.0-rc.0. But I have a crash when testing Facebook

⚡️  To Native ->  CapacitorFirebaseAuth signIn 80291333
2021-04-14 17:01:04.535333+0200 App[39744:3841177] FBSDKLog: FBSDKGraphRequestConnection cannot be started before Facebook SDK initialized.
2021-04-14 17:01:04.535835+0200 App[39744:3841177] FBSDKLog: Missing [FBSDKAppEvents appID] for [FBSDKAppEvents publishATE:]
2021-04-14 17:01:04.536417+0200 App[39744:3841177] FBSDKLog: FBSDKGraphRequestConnection cannot be started before Facebook SDK initialized.
2021-04-14 17:01:04.536681+0200 App[39744:3841177] *** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'App ID not found. Add a string value with your app ID for the key FacebookAppID to the Info.plist or call [FBSDKSettings setAppID:].'
*** First throw call stack:
(0x1a540186c 0x1ba41cc50 0x10175958c 0x101759730 0x101968538 0x10196a70c 0x1019699e4 0x1019692d8 0x101967188 0x101967294 0x100ef4dc4 0x100ef5ee0 0x100eff4d0 0x100eff578 0x101da3bcc 0x101da56c0 0x101db4f34 0x1a537d11c 0x1a5377120 0x1a537621c 0x1bcf42784 0x1a7db6ee8 0x1a7dbc75c 0x100eee190 0x1a50366b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'App ID not found. Add a string value with your app ID for the key FacebookAppID to the Info.plist or call [FBSDKSettings setAppID:].'
terminating with uncaught exception of type NSException

I have FacebookAppID set in my Info.plist and fb<APP_ID> in my URL schemes. (It worked fine with v2.4.0) What is wrong here?

dbartumeu commented 3 years ago

I confirm Google and Apple Sign In are working on iOS with v3.0.0-rc.0. But I have a crash when testing Facebook

⚡️  To Native ->  CapacitorFirebaseAuth signIn 80291333
2021-04-14 17:01:04.535333+0200 App[39744:3841177] FBSDKLog: FBSDKGraphRequestConnection cannot be started before Facebook SDK initialized.
2021-04-14 17:01:04.535835+0200 App[39744:3841177] FBSDKLog: Missing [FBSDKAppEvents appID] for [FBSDKAppEvents publishATE:]
2021-04-14 17:01:04.536417+0200 App[39744:3841177] FBSDKLog: FBSDKGraphRequestConnection cannot be started before Facebook SDK initialized.
2021-04-14 17:01:04.536681+0200 App[39744:3841177] *** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'App ID not found. Add a string value with your app ID for the key FacebookAppID to the Info.plist or call [FBSDKSettings setAppID:].'
*** First throw call stack:
(0x1a540186c 0x1ba41cc50 0x10175958c 0x101759730 0x101968538 0x10196a70c 0x1019699e4 0x1019692d8 0x101967188 0x101967294 0x100ef4dc4 0x100ef5ee0 0x100eff4d0 0x100eff578 0x101da3bcc 0x101da56c0 0x101db4f34 0x1a537d11c 0x1a5377120 0x1a537621c 0x1bcf42784 0x1a7db6ee8 0x1a7dbc75c 0x100eee190 0x1a50366b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'App ID not found. Add a string value with your app ID for the key FacebookAppID to the Info.plist or call [FBSDKSettings setAppID:].'
terminating with uncaught exception of type NSException

I have FacebookAppID set in my Info.plist and fb<APP_ID> in my URL schemes. (It worked fine with v2.4.0) What is wrong here?

I have the same issue.

baptisteArno commented 3 years ago

Ok, any idea how to debug this further @baumblatt ?

dbartumeu commented 3 years ago

I was able to solve the problem. Let me put some context: I was upgrading my app from capacitor 2.x to 3.x and inside AppDelegate.swift i had:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    FirebaseApp.configure()
    return true
  }

adding ApplicationDelegate.initializeSDK(nil) seems to solve the issue so i added it like this:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    ApplicationDelegate.initializeSDK(nil)
    FirebaseApp.configure()
    return true
  }
xinfengmich commented 3 years ago

I tested Google Sign In with v3.0.0-rc.0. It works on iOS. But on Android, it's not able to get any config values from: "CapacitorFirebaseAuth": { "providers": ["google.com", "twitter.com", "facebook.com", "phone"], "languageCode": "en", "nativeAuth": false, "properties": { "google": { "hostedDomain": "my-custom-domain.com" } },
"permissions": { "google": ["profile", "https://www.googleapis.com/auth/drive", ...] } }

aechan commented 3 years ago

Any further update on this now that Capacitor v3 is released? I'm trying to upgrade our app but this plugin is holding us back and I'd rather not fork.

johnmckay-reward commented 3 years ago

+1 Would also find this really useful

tgangso commented 3 years ago

What is the status on this? Thanks

alexookah commented 3 years ago

@baumblatt Is there any branch we can use to test capacitor 3.0?

mesqueeb commented 3 years ago

@baumblatt i highly suggest you contact the official Capacitor community slack to ask for assistance in moving this plugin over to the community organisation.

I know you are busy with your work and that you personally don't use this plugin anymore, so I think it's all the more important that you make work of passing the repo on to others.

A lot of people would love to start using Capacitor 3.0 but rely on Firebase auth.

luanlucho commented 3 years ago

Please finish releasing v3 🥺

djabif commented 3 years ago

Hey @baumblatt can I help with the testing of the branch with Capacitor 3.0 or is there any other way I can help with this issue?