How to use facebook appid to work with multiple domains (not sub domains)

489 views Asked by At

I have created an app on facebook and i am using that appid in my application to allow the users to login, like & share the content.

While creating the facebook app i have given a domain like "abc.com" in the "App Domains".

This is working fine when i access the page from "abc.com/mypage" but i want to do the same from "xyz.com/mypage", "xxx.com/mypage" etc....

The facebook login is working for only "abc.com" it is not working for otherdomains.

How can i make this work and i want the same behavior for multiple domains more than 2

Thanks,

2

There are 2 answers

4
andyrandy On

You can only use one domain per "platform". Meaning, if you got 2 different Websites, you need to create 2 different Apps. But you can use the same App for a Website on one domain and a Page Tab or Canvas App on another domain (which is useful for testing on localhost, for example).

0
user3294438 On

Solution is to have multiple applications.
Look closer at the Settings-Basic, you would find that the domain setting is at the top and is global. Try to add a second domain and you see this error message: "This must be derived from Secure Canvas URL, Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL".

And that's the solution: You can make your secure canvas url abc.com, mobile url xyz.com and siteUrl example.com.

I guess your abc.com is for "Website". So what you need to do is click "Add Platform - Facebook Canvas". And enter xyz.com/ as canvas url and example.com/ as mobile url. Then you can have three domain supporting signing in at the same time.
Facebook acknowledges that people have the need to use different domains for different purposes. But they decided to allow only one domain per purpose. The error message suggests that you may have up to five different url and hence five domains.