Today i’m working on a facebook application which needs to post to wall of user’s friend!
Here is my application http://apps.facebook.com/axcotobuzz/, and it’s a IFRAME app! So i used FB.UI with method feed or stream.publish to post to wall!
I read document carefully, it seems everything is easy here:
http://developers.facebook.com/docs/reference/javascript/fb.ui/
http://fbdevwiki.com/wiki/FB.ui
http://developers.facebook.com/docs/reference/dialogs/feed
http://developers.facebook.com/docs/reference/dialogs/feed
After go thorought over them, i then wrote my code as below:
<script>
challenge.setQuestion('<?php echo $friend->id ?>', '<?php echo $question['id'] ?>');
FB.ui({
method: 'stream.publish',
display: 'popup',
name: 'Axcoto',
link: 'http://axcoto.com/',
message: '90',
to: 100001785219571,
redirect_uri: '<?php echo $facebook->conf['canvas']['url'];?>quizz/publishPostBack/',
}, function () {
});
</script>
Clear cache, refresh app…and what i got
Sorry, something went wrong.
We’re working on getting this fixed as soon as we can.
I re-read document carefully, nothing is wrong with my code! And someone is encountering it too
http://developers.facebook.com/docs/reference/dialogs/feed
After some effort, realize that its cause is extra parameter “next” in URL which FB.UI generate
Look at my URL:
http://www.facebook.com/dialog/feed?
app_id=188071914544841&
caption=AAA&description=89.&
link=http%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fdialogs%2F&locale=en_US&message=90!&name=Facebook%20Dialogs&next=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23cb%3Df35e4913995012%26relation%3Dopener%26frame%3Df65d68044d6ac%26result%3D%2522xxRESULTTOKENxx%2522&picture=http%3A%2F%2Ffbrell.com%2Ff8.jpg&redirect_uri=http://axcoto.homelinux.org/axcotobuzz/quizz&sdk=joey
I then tried to removed it, took it like this:
http://www.facebook.com/dialog/feed?
app_id=188071914544841&
caption=AAA&description=89.&
link=http%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fdialogs%2F&locale=en_US&message=90!&name=Facebook%20Dialogs&picture=http%3A%2F%2Ffbrell.com%2Ff8.jpg&redirect_uri=http://axcoto.homelinux.org/axcotobuzz/quizz&sdk=joey
Manually enter it on address bar, it works!!! Amazing, but it DOES work!
I dunno the reason, but after figuring out it, i set “next” to null like this:
<script>
challenge.setQuestion('<?php echo $friend->id ?>', '<?php echo $question['id'] ?>');
FB.ui({
method: 'stream.publish',
display: 'popup',
name: 'Axcoto',
link: 'http://axcoto.com/',
message: '90',
to: 100001785219571,
redirect_uri: '<?php echo $facebook->conf['canvas']['url'];?>quizz/publishPostBack/',
next: null
}, function () {
});
</script>
Clear cache, F5! It works like a charm!
Hope this helps you!
