7

I'm facing a problem integrating the Facebook native app on android platform to my android native app.

Problem : The user is in FB app and clicks on the link corresponding to my app. The app should launch my app (expected behavior) but the FB app launches Google play store (actual behavior).

I have followed the procedure provided by the Facebook developer pages for native linking: http://developers.facebook.com/docs/mobile/android/deep_linking/

I have used the JDK Keytool to generate the Hash-key. But I found no errors no my Eclipse Logcat like invalid key. Am I missing something here, Please help me out.

Thanks in advance

Praveen S
  • 10,355
  • 2
  • 43
  • 69
user1520407
  • 71
  • 1
  • 3

5 Answers5

0

Please Update below code of your application.

public void loginAndPostToWall() {
    facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH,
            new LoginDialogListener());
}

And see below link for more information.

Facebook issue

Community
  • 1
  • 1
Dipak Keshariya
  • 22,193
  • 18
  • 76
  • 128
  • Hi Dipak,I'm a newbie to android and it was not clear to me from this link you posted http://stackoverflow.com/questions/10815813/android-facebook-authorization-can-not-login-when-official-facebook-app-instal . Is the guy trying to launch Facebook from his App or the other way? – user1520407 Jul 13 '12 at 07:49
  • I think he is trying to login into facebook native app from his app ,but my issue is after all that SSO login the if user in FB app clicks on a link coressponding to my app the facebook does not launch my app ? Please clarify in such a situation does any code concerning my android apphas to be modified . Thanks – user1520407 Jul 13 '12 at 08:00
  • Sorry Dipak,I updated my code, but FB app is still not launching my app :( – user1520407 Jul 13 '12 at 08:20
0

You are generating the hash wrong. Make sure you used the right command to generate the Hash:

keytool -exportcert -alias YOURALIASHERE -keystore YOURKEYHERE | openssl sha1 -binary | openssl base64

Make sure you used the correct password.

fsilvestre
  • 299
  • 2
  • 10
  • Hi user931725 , Thanks for replying , sorry I could not check your post. The procedure I followed to generate the hash was : – user1520407 Jul 24 '12 at 17:02
  • 1.Open cmd in Windows 7. 2.Typed the following in cmd : keytool -exportcert -alias androiddebugkey -keystore MyKeyStorePAth | openssl sha1 -binary | openssl base64. – user1520407 Jul 24 '12 at 17:35
  • (Exactly as given in Facebook Developers Page and only provided key Store path, which I entered as “C://Users/Shreyas/.android/debug.keystore” ) . 3. It asks for password , and I entered Android. 4. It gives the Hash Key which I have used. Sir can you explain the terms "YOURALIASHERE" and "YOURKEYHERE" (Actually I do not understand the terms involved, I just followed the procedure) and it would be helpful if you could illustrate with an example. Eagerly waiting for your reply . – user1520407 Jul 24 '12 at 17:36
  • When you create a new key to sign your apk, you give a alias to it. YOURKEYHERE, here is a file of your key, if you create it. if you dont create, you using a default key of android (.android/debug.keystore) right? In this case you need put in YOURALIASHERE the value androiddebugkey. Using default key, your command is like that: keytool -exportcert -alias androiddebugkey -keystore C://Users//Shreyas//.android//debug.keystore | openssl sha1 -binary | openssl base64 When ask the password, you put: android – fsilvestre Jul 28 '12 at 01:07
  • So that means to say that I have followed the correct procedure using default key of android. But still FB does not launch my app, Do I need to make any code changes? – user1520407 Jul 28 '12 at 09:27
0

In addition to verifying the key-hash, also make sure the package name and class name you specify exactly match what is in your code.

rightparen
  • 1,693
  • 10
  • 15
0

Make sure you signed the application before uploading it to the device. Build it like it would require to upload into PlayStore.

Benoit
  • 1,922
  • 16
  • 25
0

"All bookmarks and requests link to your Android Native App or to a Market URL if the app is not installed" from here

your problem seems related to above. of your app is not installed in the user's device the link will take to market.

Vinay
  • 1,859
  • 22
  • 26