baumblatt / capacitor-firebase-auth

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

Facebook login crash #179

Open lucapale opened 3 years ago

lucapale commented 3 years ago

This is the error after crash: Terminating app due to uncaught exception 'InvalidOperationException', reason: 'As of v9.0, you must initialize the SDK prior to calling any methods or setting any properties. You can do this by calling 'FBSDKApplicationDelegate''s 'application:didFinishLaunchingWithOptions:' method.

After updating the AppSwift as describer in Facebook documentation link, then I get the following crash error: Terminating app due to uncaught exception 'NSInvalidArgumentException'

Any suggestion to solve the problem? Thanks

alexookah commented 3 years ago

Can you provide some more insights about your issue? How is your AppDelegate.swift ?

interacsean commented 3 years ago

This may be solved with this open PR, which suggests adding the following code

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        ApplicationDelegate.shared.application(
            application,
            didFinishLaunchingWithOptions: launchOptions
        )

        return true
      }
rigoarriaza commented 3 years ago

This may be solved with this open PR, which suggests adding the following code

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        ApplicationDelegate.shared.application(
            application,
            didFinishLaunchingWithOptions: launchOptions
        )

        return true
      }

it works for me!

alexookah commented 3 years ago

@baumblatt You could merge the PR and close this ticket.

alexookah commented 3 years ago

@rigoarriaza It would be better if the Merge was in the #next branch.

interacsean commented 3 years ago

@alexookah I've updated the PR to be merging into next

baumblatt commented 3 years ago

Hi all,

This was merged on branch next and released as 3.1.2-rc.3.

Looking forward to release as latest.

Best regards.

lincolnthree commented 3 years ago

Just to confirm, this resolved the issue for me with crashing on Facebook login.

alexookah commented 3 years ago

Ok then close this issue :)