Facebook Tab / Post on user wall - facebook

I'v developed a Facebook tab in PHP and it pulls al the content from my web server.
When I try to post on a users wall using the following javascript code
FB.ui(
{
method: 'stream.publish',
name: 'Foo Bar',
picture: 'https://www.foobar.com/fb/img/pic_small.png',
caption: 'Caption',
description: 'Decription',
message: 'Message',
},
Facebook responds with 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
I found that one way to avoid this error is to register the tab as App on Facebook
and provide the Canvas URL and the Secure Canvas URL.
But what if I don't want the tab has an apps.facebook.com/appname entry url
I mean that what I want is just a FB Tab and not an app.Are there any other alternatives to post on users wall but of course using the standard fb Dialog Box ?
Thank you in advance for your time and for any help

I think that you are using old-fashioned FB.ui method type. Please, check the method 'feed'.
http://developers.facebook.com/docs/reference/dialogs/feed/
BTW, how about checking 'App Domain' setting or 'Website' setting. I also had a similar symptom a few weeks ago, then I just set the App Domain and Website URL as my domain. Yes, I know, it's very tricky ;)

Related

FB.UI Feed Dialog - cannot "share" a facebook's picture

Sharing facebook photo (really a facebook photo) using mobile web app & Feed Dialog.
The problem: Cannot send facebook's photo to the Feed Dialog.
All code works great. I get all properties as they sent to the function.
FB.ui
method: "feed"
link: 'url'
app_id: myAppID
name: 'photo's name'
description: ''
caption: $('#albumName').text()
picture: 'http://myUrl.com/logo.png'
, (response) ->
if response and response.post_id
console.log 'Photo was shared'
else
console.log 'Photo was not shared. Please try again'
If I place a static photo, to represent the Picture parameter, all goes fine, But if I try to call a facebook picture I try to share, then I get a 500 server error.
GET
https://www.facebook.com/dialog/feed?access_token=...662390597_s.jpg&sdk=joey
500 (OK)
This is totally bizarre. The URL that goes to the dialog iframe, goes with all the needed parameters, including access_token.
It seems like a design issue. Like someone in facebook don't want us to pretend to be facebook when we customly share things using their feed dialog, when we share facebook photos.
Am I right?
* Problem Solved. See my answer below *
!!! Problem Solved !!!
Facebook don't accept their own CDN as a source. We need to bypass that in order to share, therefore we can reshare a facebook the photo using a proxy.
http://images.weserv.nl does the job. Facebook accept the image as a picture param, and this way you are able to reshare their posts.
Usage example (plus width and hight to improve performance)
'https://images.weserv.nl/?url=' + facebookImageUrl + '&h=200&w=200'
I can't share facebook photo use this example
when i share with (fb.ui method feed) i get 404 error on this link
https://fbexternal-a.akamaihd.net/app_full_proxy.php?app=460125687444228&v=1&size=z&cksum=047536ba625482c9b5343f2eb94a7039&src=https%3A%2F%2Fimages.weserv.nl%2F%3Furl%3Dhttps%253A%252F%252Ffbcdn-sphotos-b-a.akamaihd.net%252Fhphotos-ak-ash4%252Ft1.0-9%252F10157304_1383818341898181_8685912667835736794_n.jpg%26h%3D200%26w%3D200"
"app=460125687444228
cksum=047536ba625482c9b5343f2eb94a7039
size=z
src=https://images.weserv.nl/?url=https%3A%2F%2Ffbcdn-sphotos-b-a.akamaihd.net%2Fhphotos-ak-ash4%2Ft1.0-9%2F10157304_1383818341898181_8685912667835736794_n.jpg&h=200&w=200
v=1"
Where my error ?

Facebook javascript send api error link invalid

I'm developing a referral application where users can refer their Facebook friends using a referral code. I'm using Facebook Javascript SDK. The problem I'm facing is that the send method works only for particular URLs, I mean if I change the users referral token in link parameter it gives me error 100 invalid link.
Here is the method :
FB.init({appId: app_id, xfbml: true, cookie: true});
FB.ui({
to : '********',
method: 'send',
name: 'Message',
link: 'example.com/emp?token=fAiS1ywL0lS8cUYtgLjk',
redirect_uri:'http://example.com'
});
For some particular link values it works fine but if the token is changed it fails with invalid link error.
I'm stuck with fixing this issue. Am I missing something?
Duplicate of Facebook FB.ui send dialog intermittently returns invalid link error.
For your second question related to the og:url meta, to simplify you have to provide the URL of the current page.
The Open Graph Protocol says:
og:url - The canonical URL of your object that will be used as its
permanent ID in the graph, e.g.,
"http://www.imdb.com/title/tt0117500/".
To understand how those metas work you can check how News websites implement this with the Facebook Object Debugger.
For example this link shows you the implemention of metas for a well-known newspaper website.

Facebook API - Fatal error: Uncaught OAuthException

I created a Facebook application, and I get this error:
Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /var/www/customers/vh-394/web/home/dev.a-soft.hu/ssl/api/facebook/xzona/sdk/src/base_facebook.php on line 1106
I'm new with developing Facebook applications and have lost the "App domain", "Site URL", "Canvas URL", "Secure Canvas URL" settings.
Probably there are some URL-settings error, but I don't know exactly how secure URLs work, and how Facebook authentication works.
Can anyone please help me about how to set these URLs above and how I can correct this error?
Thanks
EDIT:
There is a game I'd like to integrate into Facebook, so FB users can play with it, share points, etc. You can find this game here:
https://ssl.a-soft.hu/api/facebook/xzona/_index.php
If you look at this page, you can see me and some of my FB friends, but it's not real, I just learned how FB stores data in arrays so I generated them. In this file there is no connect to FB, or any FB scripts.
The real file is index.php, where everything happens. Some months ago I started to create this app using Heroku, but then I bought real ssl domain.
Anyway, the way that my app tries to connect with FB, authenticating it, is the way that Heroku uses.
So it includes "AppInfo.php", "utils.php", "FB sdk" (as Heroku), but I don't know if I failed something to use correctly.
On FB dev page, I didn't fill "App Domains" field, and under "Select how your app integrates with Facebook", I checked only "App on Facebook". In there I filled the fields exactly like this:
Canvas URL: https://ssl.a-soft.hu/api/facebook/xzona/
Secure Canvas URL: (same)
Canvas Page: apps.facebook.com/xzonahu
And now I still have the same error:
Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /var/www/customers/vh-394/web/home/dev.a-soft.hu/ssl/api/facebook/xzona/sdk/src/base_facebook.php on line 1106
Hope you can help! :)
Which URLs you need depend on exactly what kind of app you're making. Assuming you are making an app that you want embedded in the facebook frame, you should make sure that only the "App on Facebook" box is checked under "Select how your app integrates with Facebook"
You need the following URLs:
Hosting URL: This is the url where all of your resources are stored.
Canvas URL: This is the url of the page that should be displayed within the Facebook frame.
Secure Canvas URL: Secure version of the Canvas URL (making both canvas urls the same https url worked for me)
Canvas Page: This is the facebook page people visit to see your app ie. http://apps.facebook.com/myapp
All that said, there are all sorts of things that can go wrong with OAuth so if that doesn't solve the error message come back and we'll see what else it might be.

Hide application link from Facebook share (on page tabs)

I'm trying to find out whether it's possible to remove or change application link from feed post when sharing a page tab ("XX minutes ago from [app name]" next to comment and like links where [app name] is a link to the application). But the application in question only provides a custom page tab, not a real application, so it's kind of annoying when users are pointed to the app page.
I'm using FB.ui share the page tab.
Or maybe someone has alternate solution to make the user experience better?
Here's the share code (with some modifications since the app isn't public yet :)
FB.ui({
method: 'feed',
name: 'name of the page tab',
picture: 'http://url/to/image.png',
link: 'http://url/to/page/tab',
caption: 'caption',
message: 'message',
description: 'description',
actions: [
{
name: 'Participate',
link: 'http://url/to/page/tab'
}
]
}, shareComplete);
*edit: just saw that the question was two years ago, oh well, I'll just leave this here for future reference :P
What I did was create a redirect.php on my server that just does a redirect to the page tab I want:
<?php
header('Location: PAGE_TAB_URL');
exit();
?>
then, on tha facebook app, I added a website as a new platform and enetred the redirect.php url as the the site url.
Now, on the share ui, when the user clicks on the app name it redirects them to the page tab. Only downside that the redirect url is visible on mouseovering the link but I can live with that.

Why does facebook change the link in the FB.ui send dialog?

I'm creating a facebook dialog here that links to an external site (not from my domain). In the preview the link shows up correctly, but when the message is viewed in the inbox the url has been changed.
Specifically, I call this function:
var link = "http://someexternalsite.com/?id=xxx"
var desc = "a description"
FB.ui(
{
method: 'send',
name: 'title',
link: link,
picture: 'http://mysite.com/somepicture.jpg',
description: desc
},
function(response) {}
)
And the link changes (when viewed in your facebook inbox) to
http://facebook.com/someexternalsite
Is there some unwritten security policy somewhere? Do I need to get permission from someexternalsite.com to link to their site?
Facebook keeps control of the links that are posted. That way if a link is to a virus or a malicious site, Facebook just needs to change their URL.
It seems that facebook take the meta og: property.
I didn't find a way to get the link I wanted without changing the og:url.
Btw the picture is also erase by the og:image tag.