Error When Logging on Facebook/Firebase on Android - android

I am making an application that uses Facebook login, the App is on development and i am trying it on my personal smartphone (a Xiaomi). Im using a test user provided by Facebook to log in, but nothing happens, when i try to log the app says something like:
Log in error. There was an error signing into this app. Try again later
I don't know which can be the issue. When i try to do the same on the emulator it works. (it opens Chrome to Log in, in my phone it opens the Facebook App (maybe thats the problem?)
The emulator returns this as result.accessToken:
TOKN: {AccessToken token:ACCESS_TOKEN_REMOVED permissions:[user_likes, openid, public_profile, user_friends, email]}
And it shows the profile on the Authentication tab in Firebase (so it actually works). I dont know why is not working in a real device.
This are some screenshots of the app: Log Button,
Profile Selection Screen (Test Profile),
Error Message.
I dont think is a coding problem, because as i said before works fine on emulator. I have added everything on my manifest, and i implement all the libraries needed.
Like the following lines:
Manifest Code
(PD: i tried A LOT to paste the code, but this page was sending me the same error all the time, and the indentation was correct, im new so i was suffering a little with this, sorry!)

I solve it by myself, i was using the app in development mode, that means that i need to put a hash for every device im using to develop, when i run the command on my computer it gives me the hash of my computer, i used the signing report of android studio on my Smart phone, it gives me other hash, then i put it on facebook and voilá, it works now.

Related

Login using Facebook SDK for Unity3d on android always sends old AccessToken

I'm using the 5.1 SDK to log in on Android. This works first time round and I'm able to download profile pics and use the API with no issues.
When I restart the app, I'm prompted with the permissions screen again, even though I already given permissions.
When I look at the device log, I see
{"key_hash":"XXXXXXXXXXXXXX=\n","user_id":"1234","expiration_timestamp":"1404234168","access_token":XXXXX...","opened":true}
(values replaced with XXXXX for privacy)
This expiration_timestamp is parsed to be "07/01/2014 17:02:48", which is wrong.
Every time I restart the app, I get the same permissions prompt.
Have I made an error with the setup or is this a known issue? Anybody know any workarounds?
Thanks all

Facebook login on unity android app problems

I am testing an android app I created in Unity on my Galaxy S4 and I successfully log in, and everything works great! However, while changing no settings, I test my app on a Moto X device, and when I click login button and accept permission request. Nothing happens, and I do not log in.
Is their something specific I need to provide to handle different android devices to successfully use the facebook sdk?
Any tips or help is greatly appreciated!!
It should work regardless of the device
Just make sure you are asking for read only permissions during FB login (e.g. email permission)... after successfully getting the read permission then you should be able to ask for write permissions such as uploading photos...etc
switch to development build and see what the android console log show? you should at least get some errors

How to log into Facebook without the Facebook app?

I use a Facebook sample app (SessionLoginSample) to understand how to log into Facebook. My Facebook SDK is latest — version 3.0. When I have the Facebook app installed, I can log in without any problems.
The problem is when I uninstall my Facebook app and re-install the sample (so it doesn't log in automatically). I try to log in but I can see only a white empty dialog. The only option I have is to close it. Even if I wait 10-15 minutes, the dialog doesn't change.
I tried to debug the Facebook SDK but I couldn't find what's causing the error.
I tested this on LG-E610 (4.0.3) and HTC Sensation (4.0.3).
Is this facebook sdk error or I'm doing something wrong?
Edit: I tested this issue again 10 days later in the same coditions and everything seems to work as expected.
The problem might not be on your side! I have encountered a situation where one and the same request to Facebook would be answered as expected or with an "Internal Server Error 500" depending on my IP (IP/User agent to be exact).
You can be quite certain that nothing is wrong with your configuration and application when:
Your app works from another network (i.e. another IP)
When the sample app from Facebook (i.e. HelloFacebookSample) runs into the same problem.
For Android see: http://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
For iOS see: http://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/
My suspicion is that Facebook puts certain IP/user agent combinations in a temporary black list. The problem is that their generic 500 response is not helpful.
For another reported case see my question at Internal Server 500 from Facebook with sepcific IP/user-agent combination

Getting log info from a downloaded app

I have an android app uploaded in google marketplace.
I have been reported an error from a user, which happens only in a specific device.
It is not a crash, the application just doesn't work exactly as expected. I have tried to reproduce the error using the emulator with the exact android version he's using and it works fine.
I am sure I could determine the problem If I'd have access to the Logcat entries.
I suppose the answer is negative, but it is any way the user can get these entries and send them to me? ( of course I cannot tell him to install eclipse or adb to gather the log entries ).
What is the best practice to be able to get error information from your app, once it is uploaded to the market? ( I don't mean crashes where an error report can be sent by android, just something that it is not working as expected ).
The application aLogcat can do the trick.
https://play.google.com/store/apps/details?id=org.jtb.alogcat&feature=nav_result#?t=W251bGwsMSwxLDMsIm9yZy5qdGIuYWxvZ2NhdCJd
And I tested it on my 4.1.1 device.
(I don't know how to post this as a comment instead of answer)
there are several apps on android market that allows to get logs and send them by email or upload them to dropbox... I used this one: https://play.google.com/store/apps/details?id=com.xtralogic.android.logcollector

Android facebook post works on emulator but not on device - How do I get the right key Hash?

I am working on an android app that among other things also posts a string message in user's wall. The app works fine on the emulator posting the message on my on wall every time. But whenever I try to work it from a device it just doesn't post anything. From debugging so far I see that the authentication fails on the device, while it succeeds on emulator.
From my research I found this -> Android/Facebook - invalid_key on device, but not on emulator
So as far as I understand I need another key for my app to be able to run on a real device. Is there someone who can provide some simple, step by step instructions on how to retrieve this key using the cmd? I tried many things based on that topic's answer and I am currently at a loss..
Thank you in advance!
In order to have a valid key to have create a valid keystore. This is created when you follow the "export your application process". Then you have to use this 'public' keystore in order to generate the required hash for the Facebook.
Hope this helps!

Categories

Resources