I had the same problem and worked it out. You have to go into your app settings in facebook.
There is a field where you set the URL, and you will also see a field where you set your domain.
You will notice that the URL is populated but the domain field is blank. You need to set the domain to be yourdomainname.com and it will work.