Android Facebook requires reset for applinks to work - android

I have an applinks enabled app, together with applinks enabled webpage (pointing to the app). I'm trying to do this workflow:
In my app, share a link to my webpage as ACTION_SEND with EXTRA_TEXT
The webpage (e.g. http://lovelikeorhate.eu/question/LIKE/504) contains all the applinks and Facebook specific tags. You can try curl to see it.
Facebook creates a correct preview, using the og:title meta tag from the webpage. Facebook Object Debugger (https://developers.facebook.com/tools/debug/og/object/) doesn't show any errors and reports the Android App Links as present.
When I submit the post to Facebook and then click it in the Facebook app, a browser opens, i.e. applinks are not working.
If I re-login in Facebook, then the applink works as expected, starting my app. Merely deleting cache, killing Facebook app or restarting the device is not enough.
Any ideas what's causing this weird behavior? What should I change to make the applinks work on the first attempt?

I wouldn't worry about this as it's an edge case. The Facebook app may sometimes cache the result of your post, and won't necessarily have all the app links data on your device. However, users on other devices will have the appropriate app links data and link to your app. Eventually, the Facebook app will also refresh its data, and you'll be able to link from your device as well.

Related

Android Facebook Share Dialog Blocks Login Due To Embedded Browser

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.

Why the Facebook login popup opened on an external web browser app on my android device

Facebook login doesn't work on my android app.
I am using below Facebook SDK function.
LoginManager.getInstance().logInWithReadPermissions(activity, PERMISSIONS)
The web browser is opened and I faced the below screen by this upper line.
Sorry for Korean, the text means
You have previously logged into the X app with Facebook. Would you like to keep this right?
If I clicked continue/agree, there is nothing!
Just white screen...
But Actually, it works on another device!
I have two phones, and one works fine, but the other doesn't work!
The difference is web view.
Normal Case
The Facebook screen is opened on an internal web view.
Abnormal Case
The Facebook screen is opened on an external web browser app (Chrome)
I think that my app's callback is not called after the Facebook Login process.
Because it was processed on another app (Chrome).
If it was processed on an internal web view, it may work.
But I don't know how can I control it...
I'm using this on Kotlin its working fine but you have Facebook app already installed at your device
LoginManager.getInstance().loginBehavior = LoginBehavior.DIALOG_ONLY

Facebook Deep linking for android app

I have a application and i have facebook page for the same.now whenever a user clicks on Use app(call to action) button on android device whether it is facebook android app or user is logged in from browser I need to open my app installed in user's phone.
I have searched so much but came across some old posts as facebook has introduces applinks.org meanwhile.
So I am not getting how to do this thing.
When you're setting up the Call To Action button on your page, you need to select App:
Then you will fill in a URL using your app's custom URL scheme in the Deep Link box (that's what actually launches your app on the visitor's device), and the package name of your app in the Package Name box (I believe Google uses this for verification purposes).
If you haven't set up a custom URL scheme yet, this Facebook docs page explains how. That will take care of opening the app (myApp://), but if you're wanting to go to a specific piece of content (myApp://path/to/content), then you also need to follow these directions.

Branch.io: Deeplinking goes to custom URL on return

In Branch.io, I created a branch and posted the link to Facebook successfully. Here is my configuration on branch.io dashboard:
This is the link on facebook:
I click on it, it redirects me to my app successfully. Within a few seconds of the bottom screen appear, my app starts:
Now, I return to facebook by closing my app and starting facebook - the facebook built in browser seems to be continuing with going to the custom URL of (www.yahoo.com):
Within a few seconds, yahoo opens:
I would have thought that once the redirect was successful, the Facebook built-in browser would have closed and when you return to facebook, facebook would appear. I would not have expected the built-in browser to continue with the custom url as though your app was not installed.
Is there a fix for this?
If you check in the settings for Facebook you will see by default, Links Open externally is set to off.
This is definitely a nuisance when it comes to deep links especially from Facebook.
I have never used branch.io but i am assuming it is able to intercept this behavior of the deeplink open the link externally, but this does not stop Facebook from trying to render in the browser without this turned off. And it is probably unrealistic to think your users will all have this turned off by default.
But for testing now, i would turn Links Open externally to on, and see if for the time being it helps stop the issue.

Native Facebook Login experience via browser

I have seen several flavours of this question going around but nothing exactly specific nor answered so trying it myself.
I am trying to build a Facebook login experience via the browser into my Facebook-based app that will require the users to not remember their passwords as much as possible. This means that if
they log in via their desktop browser and are already logged in, it will only ask them to 'OK' the permissions
they log in from their mobile browser and are logged in via their respective native app (Android/iOS), it will simply redirect them to the native app, ask for the app permissions and redirect them back to the success page on the browser
they log in from any browser and are not currently logged onto Facebook in any form, they have to enter their password and authenticate (whether natively or via browser this does not matter)
I know how the first can be done - that is pretty straightforward using the JS SDK. The second point is the tougher bit.
I am aware of existing custom URL schemes for Android and iOS but nothing specifically really mentions how that can be used for authentication and/or authorisation of Facebook apps. Does anyone have any ideas on how this can be done?
Thanks!
In iOS use iOS facebook SDK. It will handle the login process effectively in different situations depending on the resources available. Check out this answer to know about different login flows
Integrating facebook
You're looking for Single Sign On behavior- in Facebook, use the native SDK, and instructions for setting up SSO. It includes entering your bundle id in the settings and setting up a referring url name (the name of your app usually). So what happens is- if you launch safari mobile, and log into facebook. Then, launch your app, with good integrated SSO. Then, it won't require you to login/pass, because it knows you've authenticated via browser. Same with Android.
I think what you are looking for (at least for Android) is starting an Intent on certain schema that will open Facebook app.
This is answered here Android facebook intent to show profile with class com.facebook.katana.ProfileTabHostActivity doesn't work any more

Categories

Resources