strange error with Facebook Feed dialog - facebook

We followed the Facebook example code, shown here -- this works in our app -- if you click the anchor 'a' link, its onclick handler opens a new window and the facebook feed dialog appears:
<a class="fbShareToWall" onClick='window.open("https://www.facebook.com/dialog/feed?app_id=123050457758177
&link=https://developers.facebook.com/docs/reference/dialogs/
&picture=http://fbrell.com/f8.jpg
&name=Facebook%20Dialogs&caption=Reference%20Documentation
&description=Using%20Dialogs%20to%20interact%20with%20users.
&redirect_uri=http://www.example.com/response");'>Share on Facebook</a>
The above code works fine and displays the Facebook sample of the Feed dialog.
Here is our code - we get the error message:
"An error occurred with oursite.com. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
NOTE: this is a beta site and we're running it on a staging server whose domain name is NOT the same as the domain name that "OUR_APP_ID" below is associated with:
<a class="fbShareToWall" onClick='window.open("https://www.facebook.com/dialog/feed?app_id="OUR_APP_ID"
&link=https://www.oursite.com&name=Please%20work
&caption=Just%20work
&description=Comeon%20work
&redirect_uri=http://www.oursite.com");'>Share on Facebook</a>
(note: our code has the numerical FB app_id, not "OUR_APP_ID")
"OUR_APP_ID" is 'connected' to our production server's domain name and we're kinda wondering if that's the problem.
EDIT: "we're kinda wondering if that's the problem" because the code above is on our staging website www.foo.com --
and our code above uses an app_Id that we connected to our production domain name 'www.oursite.com'.
We wonder if Facebook -- upon receiving the above request to display the Feed dialog -- is saying to itself
"okay this website www.foo.com is trying to display a Feed dialog -- but the app_id is for www.oursite.com --
so we're going to pop up a 191 error"
We tested that theory. We altered the sample FB feed dialog code at the top -- we changed some numbers in the sample code's app id.
And we get an error message now with the formerly working sample Feed dialog code but it is a completely different error message.
Any advice on this '191' redirect_uri error message?

the url format works fine with my app
https://www.facebook.com/dialog/feed?app_id=135669679827333&link=https://anotherfeed.com&name=testing&caption=Just%20testing&description=the%20test&redirect_uri=http://anotherfeed.com
check to make sure your app id is correct and that your redirecting to the domain that is set up in your app settings.

Related

Facebook share dialog - Invalid URL Error

I have created app in Facebook developer account, I have set the site URL: http://www.xxxxxxx.com
If I open the page from www.xxxxxxx.com, then it works perfectly.
If I open the page from xxxxxxx.com, then it produces the following error:
An error occurred. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application
How should I specify my URL in my app to avoid this error?
You can set URLs in the settings of your app on facebook. Add xxxxxxx.com to the form field to make it work (additionally to the www.xxxxxxx.com).
You can only use URLs that are owned / set up, correctly.

Getting this error after months of no problems - redirect_uri not owned by application

I had this problem initially when I started the Facebook integration of our site. After doing some searching, found the solution and fixed it.
Now, a few months later, it has just stopped working. Nothing was changed in either the javascript code or the app settings on the Facebook developers site. I once again set about searching, and found the same answers as before: Site URL must match redirect_uri etc.
I currently have the App Domain: "domain.com"
And the Site URL: "http://www.domain.com"
Error given:
API Error Code: 191 API Error Description: The specified URL is
not owned by the application Error Message: redirect_uri is not
owned by the application.
I'm at a loss as to what has happened. Has Facebook changed their API? (I did check their documentation, and it's still the same).
Any help would be greatly appreciated. Javascript code below:
var publish = {
method: 'feed',
redirect_uri: 'http://www.domain.com',
link: 'http://www.domain.com',
picture: 'http://pathtoimage/logo.png',
name: 'Name',
caption: 'Title',
description: 'Description, blah blah'
};
function fbcallback(response) {
// do stuff here
}
FB.ui(publish, fbcallback);
Thanks
EDIT:
I checked the timestamp and the JS file hasn't been touched since the 16th of March, neither has the App Settings on Facebook, and my colleague tested this just a week ago (was still working then)
RESOLVED:
For others that are having the same problem, here's what worked for me.
It appears that FB have tightened their security, which is why it was originally working.
We were working on a new release, and were using the IP address instead of the domain to access the site. A new message I hadn't seen previously started appearing in the dev console:
When using FB.ui, you should not specify a redirect_uri.
Looks like the FB api now checks the URL domain in the address field of the browser (rather than the redirect_uri) against the Site URL in the Facebook App Settings. Tested this by temporarily pointing our domain to the IP address, and running the Facebook api code via the domain loaded site, and it worked. So while we're testing before the release, I'll use http://localhost:8080 as the Site URL, then update it to the site's domain when it goes live.
Thanks to the people who helped to point me in the right direction!
Try to check if in your app settings (on Facebook Developers) you have set:
'App domain' with the domain where you're using the app
Check the 'Website with Facebook Login' option and then set the domain there

pagetab dialog getting error

Getting Error when i try to add a new pagetab.
http://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
inserted for
YOUR_APP_ID = id of app
YOUR_URL=www.xxxxxxxxx
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Any hints would be very helpful.
Wondering, that i did this some weeks before without trouble.
Thanx
The value you're using for YOUR_URL must be a URL on one of the domains specified in the app domains value in the app settings and/or derived from the page tab URL you're using in the 'Page Tab' settings

"redirect_uri is not owned by the application" when adding Facebook app

I'm trying to add a Facebook tab to a page using the url:
https://www.facebook.com/dialog/pagetab?app_id=256000XXXXXXX&display=popup&next=https://www.facebook.com/mypage
But I'm getting the error:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
In my settings All the URLs are correct, including the App Domains.
Facebook must have changed something because using the url 'https://www.facebook.com/mypage' no longer works. I instead needed to use 'https://www.facebook.com'.

Facebook share link error

I created a facebook app and tried it to send invite a friend or share something on my wall, but I'm getting an error.
The same link is working with another app:
my app id:313714785358239
my link: https://www.facebook.com/dialog/apprequests?app_id=313714785358239&message=Facebook%20Dialogs%20are%20so%20easy!&redirect_uri=http://www.example.com/response
and another link(working):
https://www.facebook.com/dialog/apprequests?app_id=123050457758183&message=Facebook%20Dialogs%20are%20so%20easy!&redirect_uri=http://www.example.com/response
my error:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Make sure you correctly configure domain and site URL (callback URL) to match the redirect_uri you're specifying as a parameter at the app request dialog.
You can configure these settings on https://developers.facebook.com/apps/313714785358239/summary
The App ID 123050457758183 has http://www.example.com as the callback URL and that's why it works.