Android: Concept behind KeyHash of Facebook SDK? -


i using facebooksdk , following steps generate new keyhash, keyhash generated using debug keystore working charm keyhash generated using our own couple of keystores not working, tried function given in troubleshooting it's still not working. have tried using following code in oncreate

// add code print out key hash         try {             system.out.println("inside try keyhash");             packageinfo info = getpackagemanager().getpackageinfo(                     "com.myapp.facebookint",                      packagemanager.get_signatures);             (signature signature : info.signatures) {                 messagedigest md = messagedigest.getinstance("sha");                 md.update(signature.tobytearray());                 log.d("keyhash:", base64.encodetostring(md.digest(), base64.default));                 system.out.println("keyhash:"+base64.encodetostring(md.digest(), base64.default));                 }         } catch (namenotfoundexception e) {             system.out.println("keyhash name not found");         } catch (nosuchalgorithmexception e) {             system.out.println("keyhash algo not found");         } 

it gave me keyhash, inserted in facebook app settings, no resolution! wondering concept of using keyhash, how facebook identifies it? , happen if upload app using debug keyhash?

my impression facebook matches keyhash signatures of of app , if both signed same keystore allows app authenticate doesn't seem case. exported app prepare release, downloaded apk phone through file explorer , tried installing , running there, same in debug mode.

can 1 please shed light on this.

yes, indeed case. facebook knows app signatures , verifies know if app trying authenticate right one. guess in system.out.println wrong, used following code https://stackoverflow.com/a/9600642/243354

you can insert code, export apk sign release, load apk emulator , check logcat hash key tag, once found, update facebook settings.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -