I have been a user of cordova-plugin-facebook4 for years on my hybrid apps and of cordova-plugin-facebook-connect since the facebook4 plugin got deprecated in 2019.
Recently I have been getting reports from users that the Facebook login is failing on multiple apps of mine giving the following error "For your account security logging into Facebook from an embedded browser is disabled, you may be able to continue by updating the app you're logging in from and try again"
ScreenShot
I was able to reproduce this error by uninstalling the Facebook app from the device. and by doing some research I found the following article HERE; Which basically states that Facebook deprecated FB Login authentication on Android embedded browsers beginning of October 5, 2021. I also found this community post HERE stating that it's an ongoing issue that hasn't been fixed yet. The following is a video recording of the login process if you don't have the Facebook app installed on your device VIDEO HERE.
Conclusion; When the Facebook app is installed on a user's device the Facebook SDK triggers and the login flow is completed successfully but when the Facebook app is not installed on the user's device plugin tries to trigger a browser login and you can even see it for a second before Facebook API gives this message you see "for your account security logging into Facebook from an embedded browser is disabled". I even tried to enable Embedded Browser OAuth Login from the Facebook dashboard but that didn't change the behavior at all.
Edit: After couple more hours of investigating turns out this plugin needs androidx to work and during the build, cordova-plugin-facebook4 is installed which uses Facebook android SDK version 5.13 which doesn't support custom tabs .. so after adding the following plugins everything worked just fine.
Please close this.
plugin name="cordova-plugin-androidx"
plugin name="cordova-plugin-androidx-adapter"**
I'm posting this for those who have been facing the same issue on their apps as I didn't see a similar issue here and hoping for a fix or a workaround from the bright minds in here.
Peace.
I am using the cordova-plugin-facebook-connect plugin to launch the share dialogs from Facebook. iOS is working great, and Android is working great when the app is installed.
On Android, if the app is not installed, it tries to share with an embedded web browser. After entering my email and password, I get an error saying that logging into Facebook from an embedded browser is disabled. I am using the latest version of the plugin, which SHOULD mean the latest Facebook Android SDK
I have looked on our business dashboard and made sure that embedded login is allowed:
...but that mentions OAuth so maybe it's not relevant. I have uploaded the debug and production key hashes to the dashboard
I have found nothing on the Facebook docs and I haven't gotten an answer from the Facebook developer community.
To sum up:
If the app is installed, it is all good. Without the app, it uses the embedded browser, but Facebook is blocking the login. I would love to know WHY and how to enable it.
UPDATE: Using a Facebook generated test user worked
Cheers
As Recommended by Facebook please update Dependencies to
implementation 'com.facebook.android:facebook-android-sdk:[8,9)'
Ref :
https://developers.facebook.com/docs/android/componentsdks/
https://developers.facebook.com/blog/post/2021/06/28/deprecating-support-fb-login-authentication-android-embedded-browsers/
Facebook has let everyone know that they are deprecating support for FB Login on Android embedded browsers:
https://developers.facebook.com/blog/post/2021/06/28/deprecating-support-fb-login-authentication-android-embedded-browsers/
As of right now, they are blocking High Risk users with this error and will block everyone starting in August. Their suggestion is to use a later version of the SDK (8.2+) to avoid this
I can't comment (yet) so I'm creating this answer to ask you if you could try and remove all (!) local browser data, i.e. Cookies and local storage, etc. This is the first thing that came to my mind when I read "works with another login".
The issue is resolved if the user has enabled 2-factor authentication via facebook.
I have tested this with multiple real users now and for example enabling sms-2fa does enable the user to login into apps with an embedded browser. The login happens as usual if the user has the facebook app installed on the same device and already logged in on the facebook app with 2fa. Otherwise, facebook will request the 2fa when logging in but a login is possible again.
I have however found out that some apps seem to crash if they had been opened before 2fa had been activated on a phone with a facebook app and those apps need to restarted before trying to login on them again.
From this we can assume facebook blocks out embedded browsers due to their risk assessment. 2fa is specifically presented as an option to login via unsafe browsers within the security options of each user individually and sadly does not seem to be an issue on the side of who ever is using an embedded browser within their app.
This also happened to me but I've fixed it.
I just uninstalled my Facebook application and used my browser instead.
Try installing another browser, like Firefox, and set this the default browser, then login again with your Facebook credentials. It worked to me. I guess the problem is with chrome. For me, it worked when I set Firefox my default browser.
For your account security, logging in to Facebook from an embedded browser is disabled. You may be able to continue by updating the app you're logging in from and trying again.
I've never worked with Azure.
I was suggested to use Azure AD to do the login authentication. I tried to use a couple app provided in the Documentation but they are 3 years old and are not properly working. Also one of the app log was saying that cannot be used for B2C base don the keys i provided and the other one is not even compiling
https://github.com/Azure-Samples/active-directory-b2c-android-native-msal - runs but not able to make the "Call API" button to work
https://github.com/Azure-Samples/active-directory-b2c-android-native-appauth - not compiling
Please go through the document it will help you in achieving Azure AD B2C Sign-in using an Android application.
Refer to this to set up your IOS and Android environment
There are some code sample you go through the link.
If you face any issue in the development process you can raise the SO question with your error details.
I'm developing an android mobile application that integrates with Facebook. Using this Phonegap Facebook Plugin and CLI, I followed the tutorial (show HackBook). I currently have this HackBook display to my mobile device. Unfortunately, I'm getting this error in logcat when I'm trying to login.
Should not pass a read permission (email) to a request for publish or
manage authorization THREAD WARNING: exec() call to
org.apache.cordova.facebook.Connect.login blocked the main thread for
41ms. Plugin should use CordovaInterface.getThreadPool().
Am I missing something in the Facebook Application? In my Facebook Application Settings,I have two platforms: App on Facebook and Website.
Can anyone explain to me what is happening or what did I do wrong? Should I have Android Platform too?
Thank you in advance!!!!
[Fixed] After logging in, The screen will display a blank page. It turns out that it cannot connect to my Facebook App. My facebook app setting is not configured correctly. I should make it live and public.
Facebook App Settings > Status And Review > "Do you want to make this app and all its live features available to the general public?" Change to Yes.
I'm trying to integrate Facebook 'Like' button into my Phonegap app (iOS and Android).
The easiest way is to c&p the same code as for simple web site:
<iframe src="http://www.facebook.com/plugins/like.php?..."...>></iframe>
It works perfectly (just like for normal web site) if user already logged in.
But if I log out from FB and then try to tap "Like" button I will be redirected to the FB login page and bad thing is that this page will be opened in new native browser window. So, after login it will not redirect me back to the app.
And also, if there is a way to open login page inside my app I think there still will be a problem with redirecting back to my app from FB (i.e. redirect to the local .html file)...
So, is there ANY way for Phonegap app to integrate with FB 'Like' feature somehow?
I don't think this is possible yet. The PhoneGap Facebook Connect plugin has promise, but at the time of writing this it still has a few niggles that would stop me deploying it - it's only been released for a week or two and it seems to have broken so second and subsequent logins to an app won't work. It seems like it will be really useful soon, but it's more volatile than even the standard volatility level of most Facebook integrations as it stands. Getting it to build against PhoneGap 1.1.0 yesterday also involved digging through issues in github and patching the Facebook SDK... so you'll have fun with that.
As far as I can see it doesn't support dialogs or social plugins yet, though for the base Facebook Connect use case it does solve the problem where Facebook users can be redirected out of your PhoneGap app to login either in the FB app or Safari and then bounced back into your app afterwards. It sounds like the plugin authors are working on more features, so I'll be keeping an eye on the project.
It sounds like you need the PhoneGap Facebook Connect plugin:
https://github.com/davejohnson/phonegap-plugin-facebook-connect
From the README:
"The Facebook Connect plugin for PhoneGap allows you to use the same JavaScript code in your web application as you use in your native PhoneGap application, but your native PhoneGap application will use the Facebook native app to perform single sign on (SSO) for the user."