Facebook android app error : Invalid key hash -
i have imported facebook sdk android project, first time logged in facebook android application worked, second time got error :
invalid key hash. key hash "..." not match stored key hashes. configure app key hashes @ http://developers.facebook.com/apps/..
i tried enter key provided in error didn't work.
edit: have used cmd command generates key , asks password "android"
as understand you've got key hash, still i'll put here code getting in console.
packageinfo info; try { info = getpackagemanager().getpackageinfo("com.your.project.package", packagemanager.get_signatures); (signature signature : info.signatures) { messagedigest md; md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); string = new string(base64.encode(md.digest(), 0)); //string = new string(base64.encodebytes(md.digest())); log.e("hash key", something); } } catch (packagemanager.namenotfoundexception e1) { log.e("name not found", e1.tostring()); } catch (nosuchalgorithmexception e) { log.e("no such algorithm", e.tostring()); } catch (exception e) { log.e("exception", e.tostring()); }
where "com.your.project.package"
package of project =)
next thing, dont delete previous key hash, don't conflict think. example have 2 keyhashes in facebook app.
and latest thing, , think problem. go status&review of app @ developers.facebook. , switch application public.
Comments
Post a Comment