EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 446 forks source link

Firebase Auth not working when Facebook app installed on device #675

Open PraktikerNeosoft opened 6 years ago

PraktikerNeosoft commented 6 years ago

HI, can U help me what is the problem with my app? If I installed Facebook App in my IOS device and want to login in my app I can two options. Login with email or phone and login with facebook app. If I use login with email or phone it is works fine but if I want to login with Facebook app go back to facebook login screen and nothing to do login. Video: https://www.youtube.com/watch?v=rk4Cp5txITw&feature=youtu.be Please help me. Thanx miklos

screen shot 2018-04-09 at 10 59 49 screen shot 2018-04-09 at 11 00 09
EddyVerbruggen commented 6 years ago

Sorry I don't use Facebook. Anyone else perhaps?

PraktikerNeosoft commented 6 years ago

Can I disable login with the facebook app button in facebook login page?

img_8cdaf9bea006-1

EddyVerbruggen commented 6 years ago

That’s a Firebase question, not a plugin question. So you’d better ask that elsewhere.

romandrahan commented 5 years ago

Have the same issue here... It's interesting, that the same behaviour works perfectly fine on Android, but not on iOS.

GregBowie commented 5 years ago

I have the same issue still in June 2019. Has anyone found a solution yet????

ScottAtRedHawk commented 4 years ago

My team is experiencing this issue as well... Works fine when you login on iOS and Android if you DO NOT have the Facebook app installed. The login fails if the user uses the Facebook app.

romandrahan commented 4 years ago

@ScottAtRedHawk, what error do you see?

For me the issue was due to conflicted app delegate on iOS.

ScottAtRedHawk commented 4 years ago

@romandragan We haven't been able to capture an error message since this is happening in a release build. It is only specific to users that have the Facebook app installed though. Something fails and the user is just sent back to our login page. If they click "Log in with phone or email" or whatever in the Facebook app the login works. If they choose the first button in the Facebook app breaks.

romandrahan commented 4 years ago

@ScottAtRedHawk, what plugin version are you using?

ScottAtRedHawk commented 4 years ago

@romandragan 10.1.0

romandrahan commented 4 years ago

@ScottAtRedHawk, maybe you have any other app delegates for iOS, that conflict with the Firebase one? For me it was Twitter Kit.

ScottAtRedHawk commented 4 years ago

@romandragan I am using Twitter Kit! I didn't think of that. Can you tell me what delegate issues you had to remedy?

romandrahan commented 4 years ago

@PraktikerNeosoft, I've updated setting the app delegate as following, not to conflict with the others:

const appDelegate = Helper.getAppDelegate()

      const originalApplicationDidFinishLaunchingWithOptions = appDelegate.prototype.applicationDidFinishLaunchingWithOptions
      const originalApplicationOpenURLOptions = appDelegate.prototype.applicationOpenURLOptions

      appDelegate.prototype.applicationDidFinishLaunchingWithOptions = function (application, launchOptions) {
        originalApplicationDidFinishLaunchingWithOptions(application, launchOptions)
        TWTRTwitter.sharedInstance().startWithConsumerKeyConsumerSecret(getKey(), getSecret())
        return true
      }

      appDelegate.prototype.applicationOpenURLOptions = function (application, url, options) {
        originalApplicationOpenURLOptions(application, url, options)
        return TWTRTwitter.sharedInstance().applicationOpenURLOptions(application, url, options)
      }

Helper. getAppDelegate:

export const getAppDelegate = () => {
  if (application.ios.delegate === undefined) {
    var UIApplicationDelegateImpl = (function (_super) {
      __extends(UIApplicationDelegateImpl, _super)

      function UIApplicationDelegateImpl () {
        _super.apply(this, arguments)
      }

      UIApplicationDelegateImpl.ObjCProtocols = [UIApplicationDelegate]

      return UIApplicationDelegateImpl
    }(UIResponder))

    application.ios.delegate = UIApplicationDelegateImpl
  }

  return application.ios.delegate
}

BTW @EddyVerbruggen is using the same technique in his plugin, while the Twitter — doesn't :(

Hope code above would help you.