I have integrated face book and Google plus login its working fine. But this functionality is not working in Signed apk.
Asked
Active
Viewed 50 times
0
-
3Possible duplicate of [Google sign in signed apk not working](https://stackoverflow.com/questions/36045652/google-sign-in-signed-apk-not-working) – AskNilesh Mar 09 '18 at 09:11
-
https://stackoverflow.com/questions/27272403/facebook-and-google-login-is-not-working-in-android-in-signed-apk – AskNilesh Mar 09 '18 at 09:12
1 Answers
0
Choose "Build Variants" in bottom left side of AndroidStudio,change build variant into "release".
Add this to your MainActivity
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String hashKey = new String(Base64.encode(md.digest(), 0));
Log.i(TAG, "printHashKey() Hash Key: " + hashKey);
}
} catch (NoSuchAlgorithmException e) {
Log.e(TAG, "printHashKey()", e);
} catch (Exception e) {
Log.e(TAG, "printHashKey()", e);
}
After getting Hash Key remove above code and add it to facebook and google+ developer accounts where key hashes are added.
Levon Petrosyan
- 8,815
- 8
- 54
- 65