I am trying to integrate Facebook into my application. When someone clicks the “Connect with Facebook” button in my app, a dialog appears that says “Invalid API key specified”. Here is my code:
<fb:login-button onlogin='requestPermission();' length='long'></fb:login-button>
$(document).ready(function () {
FB.init({
appId : '[MyAppID]',
status : true,
cookie : true,
xfbml : true
});
});
function requestPermission() {
FB.Connect.showPermissionDialog("publish_stream", permissionGranted);
}
I have verified that ‘[MyAppID]’ is in fact my application ID. When I log into https://developers.facebook.com/apps and look at my application, everything looks setup properly. Can somebody help me identify what I’m doing wrong or what I should be looking for?
Thanks
FB.Connect.showPermissionDialog is really old stuff and may be deprecated soon, so you should use the newer Social Plugin for logging in
https://developers.facebook.com/docs/reference/plugins/login/
or you can use the Javascript SDK’s login
http://developers.facebook.com/docs/reference/javascript/FB.login/