0

Facebook integration works fine when running App on a device from eclipse, the App is signed here with debug key.

However I have now published the App and get the error:

"Invalid android-Key parameter. The key ******* does not match and allowed key.

I have added the the new publishing key to the App settings on Facebook, and added the key posted on the Facebook error as described here.

This is very frustrating, i had this issue when developing the app using the debug key where I added the key generated from the FB error to the App settings in FB and it worked, however this will not work now:)

PS I know I have the correct publishing key as I have out this into Google Map app settings and maps works fine!

Manifast:

<!-- meta data fro FB API -->
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
        <activity  android:name="com.facebook.LoginActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
             />

Im following FB developer instructions here.

I get my release key here:

keytool -list -alias DistributionKeyStoreAlias -keystore "/Users/callanmooneys/Desktop/Android Devolpment/Distributionkeystore" -storepass password -keypass password

Any input much appreciated, (Note. FB has been a constant pain in my neck developing this app!!!)

Community
  • 1
  • 1
dancingbush
  • 2,131
  • 5
  • 30
  • 66

1 Answers1

-1

Appears you do have to add the key from the error genersted by facebook to your facebook app settings.

Had to code an email intent from the facebook activity that captured the key sent to Facebook programatically .

Once I emailed the Facebook error to myself I could correctly copy the key from the error and add to the Settings on Facebook App, instead of trying to manually type it form error generated on android device .

Could not get this key from logcat as running from eclipse used the debug keystore key not the release key.

Is there a way to debug a published app?

Anyway what a pain, this seems to be a common enough issue.

Why does the facebook documentation not mention this?

Would save a lot of time.

In onCreate()

     Override 
public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState);
 try { 
PackageInfo info = getPackageManager().getPackageInfo( "com.facebook.samples.loginhowto", PackageManager.GET_SIGNATURES); 
for (Signature signature : info.signatures) {
 MessageDigest md = MessageDigest.getInstance("SHA"); 
md.update(signature.toByteArray());
 Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); }
 } catch (NameNotFoundException e) {
....
dancingbush
  • 2,131
  • 5
  • 30
  • 66