facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 906 forks source link

Login Behavior Enum usage is broken with newest version of FBSDKLoginKit #505

Open phil-flyclops opened 5 years ago

phil-flyclops commented 5 years ago

🐛 Bug Report

The Podspec for this repo uses the newest version it can find of FBSDKLoginKit. https://github.com/facebook/react-native-fbsdk/blob/master/react-native-fbsdk.podspec#L22

This dependency changed to deprecate all of the LoginBehavior enum values aside from Browser in the past day.

Code from FBSDKLoginKit:

typedef NS_ENUM(NSUInteger, FBSDKLoginBehavior)
{
  /**
    This is the default behavior, and indicates logging in via ASWebAuthenticationSession (iOS 12+) or SFAuthenticationSession (iOS 11),
    which present specialized SafariViewControllers. Falls back to plain SFSafariViewController (iOS 9 and 10) or Safari (iOS 8).
   */
  FBSDKLoginBehaviorBrowser = 0,
  FBSDKLoginBehaviorNative __deprecated_enum_msg("Use FBSDKLoginBehaviorBrowser.") = FBSDKLoginBehaviorBrowser,
  FBSDKLoginBehaviorSystemAccount __deprecated_enum_msg("Use FBSDKLoginBehaviorBrowser.") = FBSDKLoginBehaviorBrowser,
  FBSDKLoginBehaviorWeb __deprecated_enum_msg("Use FBSDKLoginBehaviorBrowser.") = FBSDKLoginBehaviorBrowser,
};

This breaks the following switch statement at compile time because every case is trying to match the value 0 https://github.com/facebook/react-native-fbsdk/blob/master/ios/RCTFBSDK/login/RCTFBSDKLoginManager.m#L129

Code cannot be compiled so anything involving react-native-fbsdk is unbuildable.

The next version completely removes any other login behaviors https://github.com/facebook/facebook-objc-sdk/blob/master/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginManager.h#L84

To Reproduce

Attempt to build an ios project depending on the react-native-fbsdk podspec

Expected Behavior

A build that is reproducible if no explicit changes have happened in react-native-fbsdk itself

Code Example

Environment

muresanandrei commented 5 years ago

For the moment you can put a working version in podfile for this. Until react-native-fbsdk is fixed.

    pod 'Bolts',         '~> 1.9'
    pod 'FBSDKCoreKit',  '~> 4.42.0'
    pod 'FBSDKLoginKit',  '~> 4.42.0'
    pod 'FBSDKShareKit' , '~> 4.42.0'
thangbomvn commented 5 years ago

It's the same with FBSDKLoginKit for IOS :( I want to user Web Behavior, but in FBSDK 5, it is removed. Any one can share me another way to force user enter username, password when login with facebook. At the moment, if i log in facebook in safari, then, i clicked button login with facebook in ios app, FB use account which i have logged in in safari. But i want user can enter other account.