You know when you create a tab application you have Page Tab section with Page Tab URL: and Secure Page Tab URL:. In my app i want to use FB.init for Fb.login but if I call FB.init i get this error.
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
And this is because I dont complete the App on Facebook section from the App configuration, the idea is that i don`t want to complete. What is the alternative?
It might sound counterintuitive, but in your app settings (right near where you set up your Page Tab URLs) you need to open the Website with Facebook Login section and fill in a Site URL. A typical example would be http://mydomain.gov:8080/, but you can include a longer path than / if you want. Also, if you haven't already filled in App Domains, add a domain there to match the Site URL. In my example, it would be mydomain.gov.
The pages that you use the JS SDK on, as well as your redirect_uri in any dialog URLs, needs to begin with the Site URL that you configure.
Related
I found this in javascript console
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
when I tried to share a link on Facebook. Here is the Link. The problem is, the share dialog does not show the image.
Any Suggestions?
The error is quite straight-forward.
You have not properly configure the application settings. Make sure you've added the correct link in the Site Url
We are creating a canvas app and would like to add directly to my fanpage.
There are 2 ways that I'm not sure about how to take the user to the app's fanpage.
First would be to create a tab and add it in the fanpage.
On this tab would have some text and a call-to-action to redirect to app canvas.
Would create a second tab and add it in the fanpage only with a redirect to take the user directly to the fanpage of the app.
Is there any documentation specific to this practice or some restriction to redirect the tab?
To see if your app was loaded inside a page tab, parse the signed_request server-side and look if there is a page-id set.
If so, answer that request with a minimal HTML document containing not much more than a piece of JavaScript code to redirect inside the top window instance, like this:
top.location.href = "https://apps.facebook.com/yourappsnamespace";
There should be no restrictions on that – Facebook is only worried about automatically redirecting users away from Facebook (to outside domains), but since you are redirecting to a canvas app, they stay on their site.
The docs clearly state:
We do not accept Canvas pages that redirect to Page Tabs, or vice
versa.
i have a tab in a page, with an iframe to a site built up to be like a simple facebook app, where users can create simple profile pages with an image and some text.
Now, once the profile is created (which is a simple html page with its own URL), i need to be able to share it, using some sharing services (like addthis) or even the standard send button. The problem is that the original site has to be always hidden (users have to not be able to see the URL of the "site"), but the sharing system need an absolute URL to know... what to actually share.
Obiouvsly, working in an iframe, the url is always that of the facebook page (it doesn't change navigating the site's pages), so how can I do this?
Thanks.
The problem is that the original site has to be always hidden (users have to not be able to see the URL of the "site")
Why not?
Please don’t say “security concerns” right now, because you should know there is no such thing as “security by obscurity” …
If you just want to have Open Graph URLs, that can be liked and shared, but want the user clicking on one of those URLs end up being in your iframe tab on Facebook again – then do a redirect to your page tab for actual users.
Either do it via JavaScript (which the Facebook scraper does not care about); or with a server-side redirect for any client that is not the Facebook scraper (it’s identifiable by it’s user agent or originating IP address of the request).
For example, I have the application starting at index.php. The user navigates to about.php within the iframe, likes that specific page and shares it. What would the structure of the url look like to take people clicking from their own timeline into that page of my iframe?
Thanks!
This depends, if you are on a FanPage it does not work (directly)
on a App Page its easy. You simpley dont link relative in your iframe, but outside to the facebook page itself, for this to work your Canvas url needs to be a directory.
Then you can link to ie. http://apps.facebook.com/yourcanvas/about.php (dont forget the target _top)
On a FanPage the only way i know is to use beside the tab setting, a canvas app page.
in your share code you set the app page as target (with parameter) and on the app page you set a session variable for the desired target and then redirect back to the fanpage.
on the fanpage you look if you have an target value in your session, if so redirect the user.
I am trying to set app_data to a specific tab page. So a facebook user who clicks the page tab will have the app_data available.
I was trying to add app_data to the pagetab dialog url
I tried the following urls:
www.facebook.com/dialog/pagetab?app_id=290672084311996&redirect_uri=https://apps.facebook.com/artware/?app_data=aa
www.facebook.com/dialog/pagetab?app_id=290672084311996&next=https://apps.facebook.com/artware/?app_data=a
www.facebook.com/dialog/pagetab?app_id=290672084311996&next=https://jbartfb.herokuapp.com/?app_data=a
www.facebook.com/dialog/pagetab?app_id=290672084311996&redirect_uri=https://jbartfb.herokuapp.com/?app_data=a
none of them worked for me.
thanks,
shai
You redirect URIs may not contain query params. However: When you redirect to a canvas app (look like you do) you can always use rewrite rules to pass params. For example:
https://apps.facebook.com/artware/landing/install/param1/param2
Everything after your base URL (https://apps.facebook.com/artware/) is just appended to the url of your canvas app. So if your canvas URL is https://mydomain.com/myapp/ the previously mentioned landing URL would load https://mydomain.com/myapp/landing/install/param1/param2 inside the IFrame. From there you can redirect the user to whatever URL you like, query params and all.