When developing android applications that uses Facebook’s LoginButton to authenticate and authroize, there will be no issues running on the emulator. But when the same apk file (android installation file) is installed in an android device and executed it won’t work. The Facebook’s LoginButton, after clicking, progresses a while and returns back to the same screen taking us nowhere.
There could be several reasons for this behaviour but I have came across a couple of symptoms and was successful in addressing those:
1. You might have not set the hashkey for your application in facebook or you might have messed up/changed your working android debug.keystore file locally in your system.
If you have not yet set the hashkey for your application, please generate hashkey for your application first, then set the hashkey for the facebook application. Here is the article that explains in a step by step manner to create your hashkey: http://hemant-vikram.blogspot.in/2012/05/generating-hashkey-for-android-facebook.html
At times when working with our android application we may sometimes use other’s debug.keystore file and replace our’s to see if some of our issues go away. Now if we generate the apk file and install in the device to test it out, we will notice this issue. To resolve we will have to re-generate hashkey and set that in the facebook apps.
2. You might have missed the invocation of super method in the protected void onActivityResult(int requestCode, int resultCode, Intent data) method block
If you have missed, then add the following as the first line in your method block:
super.onActivityResult(requestCode, resultCode, data);
Hope this helps you to resolve your problem and importantly save some time…
Happy Androiding
No comments:
Post a Comment