funerr
funerr

Reputation: 8166

Facebook denies access of my app

I have an app that shows the share popup. I have encountered a problem when trying to get it working form a different server. I get the following error:

Error An error occurred with myapp. 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 can I enable it to work from all servers? no matter if they are mine or not? Any suggestions?

Thanks in advance.

Note: I would like it to be via the JS SDK.

Upvotes: 1

Views: 1764

Answers (1)

Nitzan Tomer
Nitzan Tomer

Reputation: 164297

Facebook apps can only work with one main domain.
The main domain is derived from either the "Site url" or the "Mobile web url" as defined in the app settings page in the Developers application.

You can however add subdomains for that same domain.
For example, let's say your "Site url" is http://app.example.com, you can add more subdomains which you want to use with facebook by adding them to the "App Domains" field in the settings page (basic tab).
You can add subdomains like: http://sub1.example.com or http://example.com.

If you try to add a url that does not derive from that you should get the following error message when trying to save the settings:

Error
DOMAIN_YOU_ADDED must be derived from your Site URL or your Mobile Web URL.


Edit

You have a problem if you want to use the FB.ui method.
The fb sdk will only accept usage from your own domain, and if you load an iframe from your own domain then the parent window (which is of another domain) won't be able to communicate with that iframe (same origin policy).

What you should be able to do is use the direct url of the feed dialog:

http://www.facebook.com/dialog/feed?
  app_id=123050457758183&
  link=http://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

You can open that in a new window/tab, or if it's an action of a user click then even open a pop-up.
But you won't be able to use the iframe dialog of the sdk.

Upvotes: 2

Related Questions