Alzim i think you need a seperate api code for each site. I dont know if its possible but maybe you can have the facebook plugin installed twice by renaming it to a facebook2 folder?
I am curious why you run the sites with both domain names for the same site?
i think from an SEO prespective it would be best to use one domain name and have the other forward or redirect to it.
It would probably solve a lot of your development issues down the road.