This code worked well in many Facebook apps on mobile devices:
FB.ui({
method: 'apprequests',
message: 'some message'
}, function(response){
console.log(response);
});
But not anymore. The dialog opens up, but its not loading friendslist to send the apprequest.
No errors, no changes from my side. Seems like Facebook dropped some kind of mobile support?
This sounds like the following bug report: https://developers.facebook.com/bugs/1483731408567352/
Can you confirm that it is the same? If so, please subscribe to that bug report to stay posted.
Related
I'm working on a game using Facebook, but not hosted by Facebook. One of the things I would like to do is to invite other people via Facebook to play a game. I've found the invite API, that looks something like this:
FB.ui({method: 'apprequests',
message: 'Some message goes here',
},
function(response){
// Do stuff here
}
);
Ideally I would like clicking on the link from that invitation to go to my web site, but there doesn't seem to be a way to do that. Am I missing something completely, or does this just not seem to do what I think it should at all?
I'm having some issue in making social feeds work under ie9.
in this page http://www.axo.com/us/news/ there are the standard Facebook and twitter feeds widget and in ie9 are both not working.
At this other page: http://www.axo.com/us/fbfeed I'm developing a custom Facebook feed following this tutorial http://tutorialzine.com/2011/03/custom-facebook-wall-jquery-graph and I get a white page under ie9
this jQuery plugin use the direct call to 'https://graph.facebook.com/pageId/posts/?access_token=XXXXXXX&callback=?&date_format=U&limit=15
I've read some post that sudgest to use the javascript SDK instead of calling graph.facebook.com. I've made a try
jQuery.getScript('//connect.facebook.net/en_UK/all.js', function(){
FB.init({
appId: 'xxxxxx',
});
var pageAccessToken = 'xxxxxx';
FB.api('/axoracing/feed', {
access_token : pageAccessToken
}, function(response) {
alert("FB.api response")
});
});
but under ie9 the alert doesn't show... so I imagine the call to /axoracing/feed is not getting an answer.
even more strange: if I try to console.log() something it doesn't work in any browser (firefox, safari, chrome, ie, ...). It is really odd and it will be a mess to use the responded object if I can't log it!
I'll really appreciate any help.
Thanks
Daniele
IMPORTANT UPDATE:
For debug purpose I made a test page that call the graph api, the sdk api and the Instagram api. Instagram and graph.facebook calls work in the same way so I inserted the instagram call to check if the issue is in the capability of IE to understand the responded json (I've read this in some answare here in stackoverflow) or if it is an issue only related to facebook.
http://www.axo.com/prova.html
If I look at this page with chorme, firefox, safari and even ie7 it works fine. If I load the page with ie9 or ie11 I get only the instagram feed... no response at all from facebook!
I haven't tested ie8 or ie10 yet.
Do you have any idea? I can't believe it is a facebook incompatibility with ie... I'm sure I'm making something in the wrong way, but what?
Thank for the help
Daniele
i am trying to add the stream.publish functionality to my web app, but i'm having a problem with the 'feed' dialog.
My code is the following:
var obj = {
method: 'feed',
display: 'iframe',
name: data.name,
link: data.link,
picture: data.picture,
caption: data.name,
description: data.description,
message: data.message,
actions: [{
name: data.actions.name,
link: data.actions.link
}],
user_message_prompt: ''
}
var resp = FB.ui(obj, function(response) {
alert("DONE");
});
I can make it work if i use 'popup' instead of 'iframe' but that's not what i want.
Any ideas why the feed is just not appearing in my screen???
Thanks!
As described in Dialogs documentation
If you specify iframe, you must have a valid access_token. To get a valid access_token, please see the Authentication guide
Update:
Seems there is couple of other statements that may lead to this behaviour:
iframe: Display the dialog in a lightbox iframe on the current page. Because of the risk of clickjacking, this is only allowed for some certain dialogs, and requires you to pass a valid access_token.
And this one.
On Facebook canvas pages, Dialogs are supported only for iframe applications
There is also open BUG #246637628719849 about "Send Dialog" not working with as iframe in Page Tabs (which may, or may not be related).
Update2:
Actually in all my applications I've user FB.ui without specifying display since at the time of implementation of Dialogs iframe wasn't working well in most cases, and without it Facebook JS-SDK trying to use most appropriate display mode...
Update3:
OP had fb-root within other DOM element which was hidden, causing Dialog to be invisible (as he stated in comment)
I am trying to show a 'Post to Your Wall' feed dialog with the following code in a facebook iframe app:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:'249725835046216', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'feed',
message: 'Facebook for Websites is super-cool',
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
});
</script>
The problem is that it is appearing in a new popup window like this:
Instead of appearing as like this without appearing in a popup window:
I don't want the feed dialog to appear in a new popup windows because in most modern web browsers where popups are blocked. I don't know why this is happening. Please help.
I'm pretty sure that you get a popup if the user has not authorized your application. Facebook made it work that way for security reasons. If you prompt for authorization first, then you should get the inline dialog.
Note that the request for authorization will itself be a popup, but you only have to have that happen once. I have things working this way, the way you want, in the someecards Facebook app. Feel free to grab the javascript code, it's not specific to the app.
Try this, put FB.ui inside FB.getLoginStatus:
FB.getLoginStatus(function(response) {
if (response.authResponse) {
FB.ui({
method: 'feed',
...
display: 'dialog'
});
}
});
in my case the problem seems to have been solved by seting display to async
display: 'async',
i think this is default for page tabs and canvas, but from time to time, instead of appearing within the main window it would load a new popup..
after setting it though (page tab in my case) i haven't noticed any pop up coming up since then..
I know this is a bit old, but I stumbled across this page when trying to solve this problem for myself and none of the answers here worked for me.
For the benefit of anyone else who has this problem, this was happening for me because I was trying to call the dialog on page load. Moving it to a user triggered event (such as a click) resolved it for me.
I have the same UI issue and I don't like the pop up window too.
I just found a link.
It helps us to redirect the page in same window. But it does not solve our problem perfectly.
There's a "URL Redirection" section in the docs for the Feed Dialog:
https://www.facebook.com/dialog/feed?
app_id=145634995501895
&display=popup&caption=An%20example%20caption
&link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
&redirect_uri=https://developers.facebook.com/tools/explorer
So you can do window.location=(this url) in Javascript, setting the redirect_url correctly, and this should work without a popup.
Note that the Feed Dialog is now deprecated in v2.0, so check out the Share Dialog instead:
To share a link:
https://www.facebook.com/dialog/share?
app_id=145634995501895
&display=popup
&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer
To share an Open Graph story:
https://www.facebook.com/dialog/share_open_graph?
app_id=145634995501895
&display=popup
&action_type=og.likes
&action_properties=%7B%22object%22%3A%22https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F%22%7D
&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer
The 'display=popup' bit affects how the share screen looks, it doesn't open a new window. Possible values for display are:
async, iframe, page, popup, touch, wap
I want to create a post to a user's wall via my facebook connect mobile app. I looked on the FB developer's website and only found this to post through mobile:
http://www.facebook.com/dialog/feed?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch
along with this statement The current version of the JavaScript SDK does not yet supporting automatically selecting the correct dialog for the user's device. We expect to add this capability shortly.
Has this been fixed yet? I have been trying to workaround using the normal method:
//Post on user's wall
FB.ui(
{
method: 'feed',
name: 'MyApp',
link: 'myURL',
picture: 'http://fbrell.com/f8.jpg',
caption: caption,
description: message,
message: ''
},
function (response) {
});
But it is slow and doesn't work the way I want it to.
Suggestions?
As of now no the cannot. You can still do auto publish posts though.