Facebook Feed Dialog does not work on Chrome/Android native app - facebook

I am developing a Facebook Canvas App which allows user to post a link to their wall:
function postFeed(){
FB.ui({
method: 'feed',
link: 'https://apps.facebook.com/?????',
name: '?????',
description : '?????',
picture: '?????',
}, function(response){});
}
It works fine on desktop (all browsers including desktop Chrome) and mobile Firefox. However when I use mobile Chrome or Android Facebook App's internal browser to open it, the following message shows up when I run postFeed() and be redirected to the feed dialog:
An error occured. Please try again later.
API Error Code: 110
API Error Description: Invalid user id
Error Message: Missing user cookie (to validate session user)
postFeed() is called after I run the following code:
FB.login(function(response) {
if (response.authResponse) {
alert("Welcome!");
}
}, {scope: 'public_profile'});
However if I remove the above code, the error message disappears and I can see the feed dialog normally.
Is there any possible reasons/solution that can solve the problem but without removing the above code?
Thank you very much.

I use 'share' instead of 'feed' method and the problem is gone.

Related

Facebook Open Graph - Share Dialog not appearing from Facebook Application

Implementing Share feature on web application.
While the code below works with your favorite desktop and mobile browsers (Share Dialog shows up when clicking on the Share button), it wont work (the Share Dialog doesn't show up) when the web application is opened via Facebook Android Application (by clicking the Website URL from a post and it open's up from the website)
FB.ui({
method: "share_open_graph",
action_type: "og.shares",
action_properties: JSON.stringify({
object: {
"fb:app_id": "my_app_id",
"og:url": "url_of_my_app",
"og:title": "my_app_title",
"og:description": "my_app_desc",
"og:image": "display_image",
"og:image:width": "600",
"og:image:height": "350"
}
})
}, function (response) {});
Rule of thumb when using FB.ui is to not use FB.ui inside a Promise success callback. Facebook Application is blocking pop-ups when called inside a successful return of Promise.

Facebook API: Can't have the send dialog working. Why?

I am trying to send a message to a user through private inbox with Phonegap and the phonegap facebook plugin through this functionality:
https://developers.facebook.com/docs/sharing/reference/send-dialog
So when doing this :
FB.ui({
app_id:'XXXXXXXXX',
method: 'send',
name: "This is the name",
link: 'www.google.com',
to:to,
description:'This is the description'
});
as stated in this link : Send private messages to friends
Nothing happen. Why ?
Is it supported by the plugin ?
Please help.
Thanks
I am trying to implement the private message function in phonegap build, but it seems like its only working on desktop not in mobile device.
when I change the method from send to feed, and indicate display to touch.
It works on my IOS build, the window just popup
FB.ui({
app_id:'XXXXXXXXX',
method: 'feed',
link: 'www.google.com',
to:to,
display: touch
});
However, its not working any more when I change the method back to send.
I believe facebook api don't support FB.UI send method in mobile devices, just like what they already mentioned on their page: https://developers.facebook.com/docs/sharing/reference/send-dialog
"This dialog can be used with the JavaScript SDK and by performing a full redirect to a URL. It is not supported on mobile devices."
I STILL DON'T KNOW HOW TO SEND PRIVATE MESSAGE THROUGH FACEBOOK NOW, GOOD LUCK

Facebook API Error 100 'link' is invalid

I have my site qa.carryon.com (this is our test site). I have configured it for facebook login and send invitations. In facebook I have configured SiteURL as 'http://login.qa.carryon.com/gs/'. 'login.qa.carryon.com' is our CNAME and we are using Gigya as social third party.
Login is working fine and when users see the list of facebook friends, user will click on one of them and the facebook send dialog triggers. The link parameter for send dialog is something like this 'http://qa.carryon.com/loyalty/signup?userid=xghdt6ys&username=xyz'.
For this link am i getting the error code 100 link invalid or there is other issue in configuration. I am doing this for first time and i cant understand whats going on. Please help i am stuck with no clue.
I had this issue as well and I was using dynamic querystring parameters on a common URL. It seems you are doing the same.
I fixed the issue by forcing Facebook to scrape the URL before I attempt to send it via the FB UI Send Dialog. Use the FB API to hit graph.facebook.com with the URL posted in the id parameter and a scrape parameter set to true.
Like so:
FB.api('https://graph.facebook.com/', 'post', {
id: '[URL]',
scrape: true
}, function(response) {
FB.ui({
method: 'send',
name: '[name]',
picture: '[Picture URL]',
link: '[URL]',
description: '[description]'
});
});
Also answered here.
Does that help?

Mobile AppRequests dialog only loading for developer

I am creating a mobile web app, and the friend request dialog works perfectly for me. But when my friend tries to do the app request, the dialog page starts, but gets stuck on loading and never works. Updated info - This only happens on mobile - tested the iphone and safari (with iphone user agent)...when tested in a website browser it works good for my friend.
Here is the code I used, and I am not getting any errors - it just hangs:
function sendRequest() {
FB.ui({
method: 'apprequests',
message: 'invites you to share real-time availability',
},
function(response) {
console.log('sendRequest response: ', response);
});
}
Has anyone else seen this issue? Appreciate any help!
Thanks,
Renee
From the above code, it appears you're missing the init(), login(), getLoginStatus() calls for the second user. It works with you because you may have already granted access to your app.
See:
https://developers.facebook.com/docs/reference/javascript/
and
https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

Facebook JS SDK - Request UI

I am trying to create a Facebook Request Dialog with JS SDK inside a Facebook page iframe tab. The dialog shows up, I can select people from my friends, I get no error not even after I click "Send Request", but my friends don`t receive the notification. This is my code:
FB.ui(
{
method: 'apprequests',
message: 'request'
}, function(response) {
console.log(response);
});
LATER EDIT: I uploaded a file with exactly their code from documentation on this tab: http://www.facebook.com/pages/WebTest/255282254520859?sk=app_230016043737427 , and my friends still can`t see the requests.
Have you run it with a Firebug / Chrome console open? Maybe an exception is being generated and dumped there.