0

a busy cat ![Facebook Loggin][1]

I'm using the SimpleFacebook API with succes until i've figured out that when my app is executed on an Android 4.2.2 and i try to log in, instead showing the WebView for loggin, a prompt dialog is showed. What should i do?

Thanks in advance!!

Community
  • 1
  • 1
Billyjoker
  • 729
  • 1
  • 10
  • 31

1 Answers1

0

The webview login isn't shown, because you have facebook native app installed on the device. Just for test, uninstall the facebook app and try to login again. You will see the webview dialog window.

sromku
  • 4,663
  • 1
  • 36
  • 37
  • So, how could you check if facebook app is installed and in consecuence, catch the profile data? Thx – Billyjoker Feb 25 '14 at 13:59
  • You can get the profile data even if facebook app isn't installed. Why do you want to know if facebook app is installed on user's device? – sromku Feb 25 '14 at 14:02
  • To get the profile data please check this explanation: https://github.com/sromku/android-simple-facebook#get-my-profile-1. If you have any question, I can publish the example here – sromku Feb 25 '14 at 14:03
  • In my case, currently i get tha data from the user through the SimpleFacebook-Facebook SDK, but if the user do not login with the Facebook WebView...Anyway i can still having acces with SimpleFacebook?? My point checking if facebook app is installed is just to advice the user that he already is logged with his own app – Billyjoker Feb 25 '14 at 14:08
  • To have user data and in general perform any request, you have to login. Thus WebView in case of not installed facebook app or native popup are must. The library doesn't have an option or method that tells you if facebook native app is installed. But, you can check it by yourself by searching for facebook package on the device: http://stackoverflow.com/a/18752247/334522 – sromku Feb 25 '14 at 14:16
  • Thank you @sromku but the point is that if the Webview is not shown never, How could i have access to the user data? – Billyjoker Feb 25 '14 at 15:05
  • What do you mean by 'not shown never'. Did you do the `login()` action with this library before the `getProfile()`? – sromku Feb 25 '14 at 15:42
  • Ok, i'm just debugging my loggin code and i am getting an Exception in the login listener: onException: om.facebook.FacebookAuthorizationException: UnknownError: ApiException:Key hash 1ghxxxxxxxxxx does not match any stored key hashes. Why fails the login? This one is with the Facebook App installed, as long as if Facebook App is not installed my loggin is OK. Thx – Billyjoker Feb 27 '14 at 11:37
  • 1
    Finally i figured out the solution: adding the hash key obtained by the pinthash() methjod into the developer console i've got loggin. Pretty simple... – Billyjoker Feb 28 '14 at 15:38
  • @Billyjoker, can you please explain the solution? I don't understand. What hash key? What developer console? I am having the same issue with login failure every time I try to use it. Calls to the login action fail 100%. Thanks in advance for your answers. – Beth Mezias Oct 17 '14 at 04:40