facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.8k stars 3.56k forks source link

App crash during login after SDK upgrade to v9.2.0 #1733

Closed shalinipk closed 3 years ago

shalinipk commented 3 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

Upgrade to latest Firebase iOS SDK, login using FB successfully

Expected Results

Upgrade to latest Firebase iOS SDK, login using FB successfully

Actual Results

app crash while trying to login - validateAppID fails However, appID & URL schemes are set in Info.plist - has been working fine on previous version v8.0.0

Steps to Reproduce

upgrade from Firebase iOS SDK v8.0.0 -> v9.2.0, carthage, manual build of sources (Tried downloading v9.2.0 directly instead of building sources from scratch - seeing same results)

Code Samples & Details

Screen Shot 2021-04-30 at 12 05 03 PM
123gid commented 3 years ago

yes very helpful let try

123gid commented 3 years ago

but also can give details then do it to your end can be much much better for me.

123gid commented 3 years ago

app [online flowery pet bfm stores 472235496666144(bridgefuremarketingonline.com)

rosalyntan commented 3 years ago

Seeing a similar crash, but in isRegisteredURLScheme instead: https://github.com/facebook/facebook-ios-sdk/blob/7c3d03d3ab633703e6c69ece97b877978931a8b4/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKInternalUtility.m#L473

Terminating app due to uncaught exception 'InvalidOperationException', reason: 'fb############### is not registered as a URL scheme. Please add it in your Info.plist'

I have checked that the URL scheme was correctly set.

No crash in v9.1.0, but seeing the crash in v9.2.0 and v9.3.0.

shalinipk commented 3 years ago

Thanks @rosalyntan Let me switch to v9.1.0

rosalyntan commented 3 years ago

@shalinipk in case this helps for your case as well -- we believe the reason our app started crashing with v9.2.0 is because we hadn't included the steps in https://developers.facebook.com/docs/facebook-login/ios#delegate when configuring Facebook Login, which resulted in the SDK not properly accessing the values from Info.plist. Adding the code from the setup guide into our AppDelegate fixed the issue for us.

Not sure why it suddenly stopped working with v9.2.0 when it was working previously, but hope this helps!

shalinipk commented 3 years ago

Thank you so much @rosalyntan Turns out we were not calling this piece of code from didFinishLaunchingWithOptions

ApplicationDelegate.shared.application(
                    application,
                    didFinishLaunchingWithOptions: options
                )

Works now. Thanks a lot for your help!!