Unity Facebook SDK app request not working with mobile app - android

I am having a problem with sending request though the Facebook mobile app.
When the FB mobile app is not install, the CUI interface came up and request can send properly.
However, when the app is install, there are pop up boxes asking for permission for request, but nothing happen after that. This only happened on Android devices. It works fine on iPhone 5.
Just wonder is this a bug that created by the mobile app, or is there anyway round this ?
Thank you very much.

May be the setting openssl is wrong.I had same problem like you.When facebook app is install,when facebook sdk call facebook API,facebook app will call our app,but Android must be set keyhash,when keyhash is wrong,it can't work.IOS do not need keyhash.So openssl must be base64.Of course,you have to copy the settings to facebook website.I have solved it like this.Hope it can help you.

Related

Facebook login was disabled and now it throws errors

We have Android and iOS apps with integrated Facebook login. Recently Facebook disabled our app because "During Login, your app is crashing or hanging excessively". The problem however is not in our app's source code, but somewhere in our FB app configuration. When we try to log in with a Facebook account that is a developer or administrator in our FB app, we get an error from FB 'Unsupported request'. When we try to log in with any other Facebook account, including Facebook test accounts, we get an error "App Not Setup: This app is still in development mode....". See attached screenshots.
Note that our app was live and everything was working fine for years, until recently it was disabled.
Does anyone have an idea what might be the issue?
One thing that I notice in our FB app configuration in the Permissions and Features section, is that the 'email' and 'public profile' permissions have 'Standard Access'. When I try to change it to 'Advance Access', it asks me for my password, but then the access level doesn't change. It stays 'Standard Access'.
We are using very up-to-date SDK versions:
In our case, any communication with facebook didn't help. They can't respond to technical level and explain why and what is the error message from their part.
So the solution for us was to make a new Facebook App and set up our apps to use this new FB App ID and release them.
(this means that all the users that have our app will need eventually to go update so they can use the facebook login)
This way Android and iOS worked with latests SDK 12+
We solved this by using older versions of the Facebook SDK.
For Android we switched back to version 11.3.0. So in build.gradle we have:
implementation 'com.facebook.android:facebook-android-sdk:11.3.0'.
For iOS we had to switch way back to version 8.2.0. So in Podfile we have:
pod 'FBSDKCoreKit' , '~> 8.2.0'
pod 'FBSDKLoginKit', '~> 8.2.0'
It appeared that the problem is in the "openId" permission, which the Facebook SDK is adding silently behind the scene to the list of requested permission. On iOS we found that this is done in class FBSDKLoginManager.m in method -(NSDictionary *) logInParametersWithConfiguration: (FBSDKLoginConfiguration FBSDKServerConfiguration)
We managed to test where the problem comes from on an Android device, which doesn't have the Facebook App installed. In that case, when you try to login, the Facebook SDK opens a browser and the URL can be inspected. We saw the "openId" parameter in the URL path parameters. With that parameter in the URL we had the error message from Facebook. Then we removed the "openId" parameter from the URL and resubmitted the request and it succeeded. That gave us the clue to search where in the Facebook SDK this "openId" parameter gets added to the request and in which version of the SDK it first appears.
happen to me too During Login, your app is crashing or hanging excessively and now it get disabled by facebook and we still can't figure it out what is the source of problems

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.

Android Facebook SDK SSO "the page you requested cannot be displayed"

I've been stuck on this very frustrating problem all day and through Google I've found many people with the same problem with no answers that relate to the new Facebook API for Android. I have followed the steps listed here exactly :
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
When I run the sample app on my device I get this:
When I run it on the emulator it works. I understand this to be because of Facebook's SSO implementation. The emulator does not have facebook installed so it signs in for the first time successfully, but the device launches the facebook app and for some reason gives this error and when I travel back, it is as if I am not logged into facebook at all and there is no active session (though I am because when it launches the facebook app I can browse friends, etc.)
I cannot uninstall facebook on my device and even if I could that would be unacceptable for the app users. If possible, I'd like to retain the SSO feature, but somehow make it work!
I have spent all day going back and forth with my Hash Keys, and generated them through my device+code and with the keytool and they match so the problem is not related to that. Besides, the sample app runs on the emulator which surely means its an SSO problem. Thanks in advance.
After 8 hours of scanning through my code and the facebook docs, I simply decided to update my facebook app on my tablet ( I never use it and so never bothered to update it ) and now it all works.
I guess the Facebook app on my tablet was pre-SSO of Facebook on Android, but my created app was expecting it to be supported and giving the error.
Just to be a bit more clear, if you are either running on your device or on the simulator, make sure you have the latest Facebook APK installed. Facebook changed their permissions a while ago, and you may have to manually go to the Google Play store in order to download the updated version of Facebook (it may not auto-update for you given the permission changes).
Disabling Facebook did the trick for me. It forces the app to launch the browser and surf to Facebook that way

Invite a friend to app using Facebook Graph API

I'm trying to invite a friend to use my Facebook app, using the "apprequest" method, as described in this link: https://developers.facebook.com/docs/reference/dialogs/requests/.
However, only friends that are already using the app can see the request!
How can I send an invitation to someone who isn't already using the app?
Thanks.
It turns out I was using the right code all along, but my app was in sandbox mode!
Turning off sandbox mode fixed my issue! :)

Android facebook sso - Invalid token

I am new to facebook sso, i have integrated the SSO into my application, this works fine in android emulator, at the same time when i do this application on device, am facing the error.. shows that invalid_token , but the same thing is working in emulator. i really don't know where the mistake is.
Even i have created the keystore and mapped with facebook apps and secret id...
Still the problem is not getting resolved...
please guide me to solve this particular issue.
Thanks in advance.
There are some problems with the SSO, the errors that are caused vary, but are probably all connected to the problem facebook is having.
It has been acknowldged by facebook as you can is in the Platform Status page.
It works in the emulator since you probably don't have the android facebook application installed on the emulator, because of that the SSO process is not the one which is used but the auth process that ships with the fb android sdk.
If the fb application is installed then the SSO kicks in and then that bug gets in the way.
There's no way to solve this for now (as far as I'm aware), the only thing is to "not using the SSO" even if it's available.
Other than that it's just waiting for facebook to solve the problem (though it has been like this for about a week or so already).

Categories

Resources