API Error Code 191 when adding page tabs - facebook

I'm aware this is a very frequently asked question but I'm really new to this whole app development thing.
I am the admin of a facebook page and I want to add a tab to the side of the page. So I followed facebook's instructions and created the page tab, but when I tried to access the "add to page" dialog box, I got 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.
The URL I was using for the box to appear was: https://www.facebook.com/dialog/pagetab?app_id=317467938291427&display=popup&next=https://www.facebook.com/287sqnatc/contact
(The contact at the end is the URL for the app I wish to add.)
Where have I gone wrong, and can someone explain it in simple 5-year-old terms?

next (or redirect_uri) parameter you pass to Add Page Tab Dialog should contain either URL owned by your application or special URL https://www.facebook.com/connect/login_success.html (intended to be used in desktop applications).
You can use FB.ui method of JS-SDK with method pagetab as shown in example of Add Page Tab Dialog documentation this will automatically provide redirect_uri for dialog and allow user to add page tab without leaving your application.

Related

Add Facebook App to Facebook Page

All,
I created a facebook application in the developers.facebook.com. Then on the basic page under how it integrates with Facebook I select Page Tab. I supplied the information because I'm hosting the page and now I want to display it on my Facebook page.
How can I actually display this application on my facebook page?
Thanks!
Adding as an answer for future reference:
Check http://developers.facebook.com/docs/appsonfacebook/pagetabs and make sure you've added all the fields necessary for the 'Add Page Tab' dialog to work; most likely the dialog will fail with Error 191 if you've included a redirect_uri field with a URL other than the one in your Page Tab Url or Site Url

Facebook App as Page Tab constantly gives an error

I am trying to add a Tab to a Facebook Fan Page.
I registered as a developer, and created an app.
In the upper part I filled out Display Name, Namespace, Contact Email and I selected Apps for Pages as my category.
In the integration part I selected the Page Tab section. Filled out the Page Tab Name, Page Tab URL, Secure Tab URL and selected a Page Tab Image.
Saved everything and noted the App-ID.
When I however logon to facebook using the fan-page-account and call up the URL https://www.facebook.com/dialog/pagetab?app_id=MY_APP_ID&next=www.facebook.com I constantly get an error stating: "An error occurred with DISPLAY_NAME_OF_MY_APP. Please try again later."
What am I doing wrong?
Thanks
It seems that Facebook has made another change and has not informed anyone. Below is a new link that appears to work. Just replace APP-ID with your application ID.
https://www.facebook.com/add.php?api_key={APP-ID}&pages=1

Adding Facebook Apps to Page Tabs

I have googled and googled around for this and found the blog post from Facebook about remove app profile pages etc. I also found that you can go to this link:
https://www.facebook.com/dialog/pagetab?app_id=[ID NUMBER HERE]&display=popup&next=[URL OF YOUR DOMAIN]
The problem is what do i put in URL OF YOUR DOMAIN. I cant put a site url in the app settings because its not a web site application, its a page tab application. Any combo of URL's i try, it just errors with "URL not owned by application"
Any ideas or experiences with this?
Use FB.ui method of JS-SDK with method pagetab as shown in example of Add Page Tab Dialog documentation this will automatically provide needed info to dialog.
FB.ui({method: 'pagetab'}, function(){
// User either closed dialog or added tab, you can call Graph API to check...
});
You have to register the URL first with Facebook and then use it. First go to http://developers.facebook.com. Then go to your app and hit [Edit App]. At the Basic Info section, you'll find a textbox requesting you to enter the APP Domain. Once you save it will work fine.
I simply entered www.my-domain.com, no http, no slashes.

Where is the Facebook "Add To Page" to add an App to a Fan Page

1) I created a Facebook page http://www.facebook.com/WinePassionate
2) I created an App but didn't set any Canvas nor Page Tab URL.
But I keep reading that there supposed to be somewhere a "Add to Page" and I cannot seems to find it.
==============
UPDATE
When I try using the standard process to add the App to my Page
(as suggested by Miguel), I get the following 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.
================================
The App Website URL is pointing to WinePassionate.com
Again I have nothing set for "canvas" nor for "App on facebook".
Would that be the issue?
It changed, application don't get pages anymore, to add the application to a page use:
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
more info here:
https://developers.facebook.com/docs/appsonfacebook/pagetabs/
Cheers!
"2) I created an App but didn't set any Canvas nor Page Tab URL. "
To be able to add your app as a page tab, you must specify settings for Page Tab. At least the url is required (no tab name in settings will default to the app's name for display).
First: Why do the apps we created not have the "Add to Page" options on them in first place like all the documentation shows us it should?
Second: Using that URL was confusing!
https://www.facebook.com/dialog/pagetabapp_id=YOUR_APP_ID&next=YOUR_URL
NOT YOUR URL at the end but this:
http://www.facebook.com/dialog/pagetab?app_id=APP_ID&next=http://www.facebook.com

I want to open a facebook dialog in an iframe, instead of as a popup

The following code generates a link that when clicked will popup a facebook dialog, and once the user authenticates to facebook, they can share to their wall.
<a href="http://www.facebook.com/dialog/feed?app_id=<APP_ID>&message=<MESSAGE>&caption= <CAPTION>&link=<LINK>&display=popup&redirect_uri=<REDIRECT>" class="share-icon facebook popup" rel='Share via Facebook'></a>
I would like for the same dialog to be generated within my page using an iframe. I attempted to load it like this:
<iframe src="http://www.facebook.com/dialog/feed?app_id=<APP_ID>&message=<MESSAGE>&display=iframe&access_token=ACCESS_TOKEN&redirect_uri=<REDIRECT>&show_error=true&caption=<CAPTION>&link=<LINK>"/>
The popup works fine. But, when I try the Iframe, it loads the following 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.
Which of course seems wrong, because it's the same redirect_uri in both links.
The end result I want, is the share to be in page, and not be a popup. Any suggestions?
In the app settings (specifically Settings -> Basic -> Basic Info), is the domain of the redirect_uri specified in the "App Domain" field? In general, I get that error when I fail to do that.
(And as to why that might be happening, Facebook treats iframes much more strictly than new windows.)