1

I'm trying to create 'facebook share' links in my blog. My blog is pretty much 100% javascript and therefore using opengraph tags is not desirable/possible.

This article suggests using 'http://www.facebook.com/dialog/feed' and I have done so as instructed. Like this:

http://www.facebook.com/dialog/feed?app_id=0000000000&link=http://www.mydomain.com&picture=http://www.mydomain.com/images/image.jpg&name=Blog&caption=Blah&description=Blah&redirect_uri=http://www.mydomain.com 

Problem is: I keep getting this error when logging into facebook:

'API Error Code: 100 API Error Description: Invalid parameter Error Message: Requires valid redirect URI.'

My app is registered with a valid appID and I have not escaped the urls at all. The urls are all within my app's set domain.

Any ideas?

3 Answers 3

2

I found a way to accomplish my goal but it wasn't with the use of the direct use of the 'feed' script. I included this script in my header:

<script src="https://connect.facebook.net/en_US/all.js"></script> 

Then in my click function I wrote:

FB.init( { appId : '0000000000' }); FB.ui( { method: 'feed', picture: 'http://www.mydomain.com/images/image.jpg', name: 'the name', link: 'http://www.mydomain.com', caption: 'the caption', description: 'the description', message: 'the message' }); 

It's not the way I wanted to write it but it somehow bypasses the login error and works as expected.

Sign up to request clarification or add additional context in comments.

Comments

1

We used to get that error, we think because whoever signed up the app as http://mydomain.com and our redirect was to http://www.mydomain.com. We changed it so they matched.

Also we use the following format (we also dont escape urls):

<a target="_blank" href="https://www.facebook.com/dialog/feed?app_id=xxxxx&amp;link=http://www.mydomain.com&amp;picture=http://www.mydomain.com/photos/1222/thumbnail&amp;description=Blah&amp;name=Name&amp;redirect_uri=http://www.mydomain.com/"/>Share</a> 

The docs dont specify you have to use &amp; but it does work for us. Hope it helps

Comments

0

I think recently the facebook "Share" UI via JavaScript may have gone down. My files look fine and in tact but the share button only using the JavaScript UI is all of the sudden broken. Let me paste and explain.

This works FINE, but notice I downloaded the picture to my server and am linking to it.

echo "<A HREF=\"http://www.facebook.com/sharer.php?u='http://www.MySite.com/page_name.php?id=$id&t=$value' \" target=_new><img src=\"images/FB_Share.png\" height=\"18\" width=\"56\"></a>"; echo "<script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"> </script>"; 

This script is not working where I pull the image from FB.

echo "<a name=\"fb_share\" type=\"button\" share_url=\"http://www.MySite.com/page_name.php?id=$id\" target=_new>Share</a> <script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"> </script>"; 

Not sure if that helps. This page has work fine for MONTHS and no changes ... that I am aware of have been made to this file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.