Is there a way of having multiple URLs in the web url box (http://i.stack.imgur.com/zOpqX.png)
I am testing locally but want to test it on the server too.
No, there isn't - what are you trying to achieve with that?
Facebook uses the mobile web URL to redirect any users who hit your canvas link (http://apps.facebook.com/YOURAPP) on mobile, so having multiple URLS there wouldn't work.
Here is an article from last year regarding multiple domain names.
When testing live and local, I'll normally have a live and a staging application set up and then simply switch my app Id and secret based on the url.
Related
I have the basic OAuth2 working with Facebook but it appears that I need to setup multiple apps in FaceBook to support. When I add platform, I can add only 1 web site and it has a URL. Seems like I need multiple facebook apps to support different environment.
I can configure it for local host and it works, I can reconfigure it for azure and it works, but I can never get both to work. I did configure multiple re-direct URIs to each environment.
Am I correct that I will need multiple facebook apps (appid and app secret), one for each environment?
Yes, you do need multiple apps for this to work under different domains. Facebook now offers the ability to create an app which is the "test version" of an existing app. You will still end up with different apps/app Ids so you need a way within your application to initialise the FB API with the app ID which is configured for the given environment.
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,
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).
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.
I'm creating a Social Media management webapp. This webapp will be used by our customers on there own sites (read, own domains). The webapp connects to a facebook app that we own, to allow them to manage there pages.
I'm using the "Website" platform for the app. During development I've had the "Site URL" set to my localhost url, and the "App Domains" set to localhost. This has worked fine.
However I now realise that this app will not always be run from localhost. It will be run from many differnt domains. I've read many posts about how its not possible to do this anymore, or at least the max is 5 domains by adding multiple platforms.
So how am I supposed to do this? Will I need to create an app on my profile for each customer/site? Will I have to create an app on each customers facebook account and link its app ID to our webapp?
The solution for this was not so bad.
Since AccessTokens are portable, so you can generate them on a single domain, and then use them to access the API from any page.
To do this, I have setup a single page on my own server (not customers server), whos domain is in my Apps Domains property. This page just has the facebook JS SDK, and some code to handle whether or not to show a login or a logout button. I embed this as an iFrame inside my webapp (that can run from any URL). I use
FB.Event.subscribe('auth.authResponseChange' function {});
to look for status changes, then use the the JS postMessage method to send the result of this to the parent of the iFrame, who then sends it to the server. This AccessToken can then be used anywhere.
I have a Facebook app. This app is a "Website with Facebook Login". However, I need to use it across several URLs. One for development, one for testing, and one for production. My urls looks like this:
Dev - http://localhost:[dynamicPortNumber]
Test - http://mysite.azurewebsites.net
Prod - http://www.mysite.com
Unfortunately, I cannot figure out how to allow multiple URLs to be associated with this app so that I can do end-to-end testing. Can someone please explain to me how to do this?
If you are using multiple top-level domains, the only way to handle this would be to create new App IDs for each instance (dev / test / prod).
However, if you have the freedom, using multiple subdomains in the same top-level domain will get you the result you are looking for. For example:
Dev: dev.mysite.com
Test: test.mysite.com
Prod: www.mysite.com
This will allow you to use the same Facebook App ID across all domains, as long as you use "mysite.com" as the App Domain.
Don't forget to add your site's URL in the "Site URL" box in the "website with facebook login" section!
NOTE: I have, in the past, had to add each individual subdomain in the app domain box in an app for it to function properly, but usually it's because I've made an error somewhere else.
Sadly there is no way to deal with the issue of different URLs for development, testing and production using a single Facebook App ID, you will have to create 3 different App IDs for each of the cases and use them at different places.
You can also check out Getting Started with Your Facebook App on Heroku that does the same.
What is App Domain used for in Facebook Apps?
Somebody had asked the same in What are App Domains in Facebook Apps? but I didn't really get it.
What I am trying to do is "publish actions" from a mobile app. The object to be published must be stored in a separate web page. And the domain of the separate page is supposed to be included in app domains.
Is app domain applicable for Mobile apps as well?
Well AppDomain simply means where is located your application's server side files.
Your application only usable from that domain. Facebook needs data for cross domain and security issues.
Unless you're going to use FB auth for a website you don't need to fill App Domain input.
I encountered the same issue for my mobile app. To fix it, I set the App Domain to my domain. But that wasn't enough because I then got the error:
Error
You have specified an App Domains but have not specified a Site URL or a Mobile Web URL
puurbuy.com must be derived from your Site URL or your Mobile Web URL.
So I had to go one step further and enable "Website with Facebook Login" setting the URL to my homepage, even though I do not have a Facebook login on my website. A terrible work around in my opinion, but it worked.
Because not using Sandbox Mode:
1. Had to establish a category on appdetails page
2. Had to set Website with Facebook Login
3. Then able to set App Domain
Now the debug pulls in the correct information without error.
App domain is not something related to your app or web domain, this is basically a App Store address.
Simply write this line in App Domains.
apps.apple.com
this worked for me.