7

At first I thought this was my app but I get the exact same problem when using any of the FB sample apps.

Take the HelloFacebookSample for example, which gives you a login button and after login shows you your pic and enables you to post status updates.

If I don't have the FB app installed on my phone the login button gives me a web view which i login through and the photo appears in the app and i can make posts. However if the FB app is installed on my phone it brings up a dialog saying the app would like to access you public profile etc. I press OK and..... nothing.

I have found many questions that seem similar but the problem was usually using a debug key as opposed to a release key, but I am running from eclipse so the debug key is still appropriate.

Any ideas?

Jake
  • 122
  • 2
  • 7

3 Answers3

7

if there is the default Facebook App is installed in your phone or if you are trying to upload your app on Google Play, then you need a different KeyHash. because, when u developed your FB app you have registered your FB app with a key hash which is created by using the default debug.keystore.

so, now u need a different KeyStore to generate the different KeyHash. u need a signed KeyStore, which u can get by the help of this tutorial , after generating new keystore, generate a key hash and register your FB App with this new key hash. this should work. for generating new KeyHash u can follow this link

Community
  • 1
  • 1
Shoshi
  • 2,194
  • 1
  • 26
  • 42
  • 1
    Ahhhh that was it. I used my release keystore. Thanks – Jake Feb 27 '13 at 09:17
  • @shoshi I tried using my app keystore file and generate new hash key and application key but still not working for me. I want to login in my application with the installed FB application login. I am always found session.isOpened() = false. Can you please help me I am stuck on this. I didnt found any useful way/article to solve this. – anddev Jul 05 '13 at 05:19
  • @shoshi you can see my code here :: http://stackoverflow.com/questions/17464648/how-to-get-default-facebook-app-login-session-in-to-our-application-in-android – anddev Jul 05 '13 at 05:25
1

I found the next line that helped me in the above scenario:

mLoginFacebook.setReadPermissions(Arrays.asList("email"));

it comes right after:

mLoginFacebook = (LoginButton) rootView.findViewById(R.id.authButton);
mLoginFacebook.setFragment(this);

solved all my problems.. Cheers

nitzanwe
  • 392
  • 4
  • 17
0

I would try and follow this tutorial to see if you can get a sample app that you build yourself to connect with Facebook. I had issues connecting the sample apps with Facebook as well. I would also check that your app id from Facebook is in your manifest file.

https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/

Jacob
  • 900
  • 6
  • 17