Facebook messenger link sharing does not work with a message - facebook

I can initiate dialog to send a link to Facebook Messenger. Everything goes fine and recepient gets the message with URL. However, when a message is added in Facebook's UI, only that message is received and URL NOT.
Message field causes link to be ignored in received message
Desktop
I have tried both methods according to
https://developers.facebook.com/docs/sharing/reference/send-dialog/
URL
https://www.facebook.com/dialog/send?display=page&link=https://developers.facebook.com/docs/sharing/reference/send-dialog&redirect_uri=https://www.facebook.com&app_id=<APP_ID>
SDK
window.fbAsyncInit = function () {
FB.init({
appId: '<APP_ID>',
autoLogAppEvents: true,
xfbml: true,
version: 'v11.0',
});
};
FB.ui({
method: 'send',
link: 'https://developers.facebook.com/docs/sharing/reference/send-dialog/',
});
I have tried different SDK versions and different APP IDs.
Mobile
Curriosly so, my setup for mobile works fine, link is received with or without a message.
fb-messenger://share?=<APP_ID>&link=<MY_LINK>
I am really confused as there does not seem much to configure... Thanks in advance for any leads on this.

It has been acknowledged as a bug by Facebook already in May https://developers.facebook.com/support/bugs/201777038410094/
Again reported in July
https://developers.facebook.com/support/bugs/2934678630125393/?join_id=f3c21b71e26d8c

Related

Facebook Page Tab : Error 191 (The specified URL is not owned by the application) but URLs are set

For a contest page, I use Page Tab within a Facebook App, but I can't set a Share dialog without getting this error.
window.fbAsyncInit = function()
{
FB.init({ appId: '##### (correctly set)',
status: true,
cookie: true,
xfbml: true,
oauth: true});
FB.Canvas.setAutoGrow();
}
window.fbAsyncInit = function()
{
FB.ui({
method: 'feed',
name:'name',
link:'https://expertsmo.ca/_fb/concours/1', // https://apps.facebook.com/expertsmo
caption:'test'
});
}
Here is the App conf
I checked many posts on this error code, most of these problems are caused by the URL not being set; in my case, URL is well set and I still get this error. I tried many many things, still not working ( this solution of a similar case doesn't seem to work because I can't find the field "Website With Facebook Login").
I also use PHP sdk to find out if the user likes the page already, or not.
Really, I can't find the solution to this problem ... any idea? Thanks...
You include the JavaScript SDK two times in the code, only one time with an App ID (that is different from the FB.init call). Make sure you are using the latest code from the Facebook docs and clean up old stuff. That error message comes up when the App ID is not correct, the settings should be fine.
https://developers.facebook.com/docs/javascript/quickstart/v2.0
You also use window.fbAsyncInit in a wrong way, this should only be used once when you open the page. FB.ui should get called on user interaction or you will also get problems with popup blockers.
Btw, you should put ALL JavaScript code right before the closing body tag (for many reasons). Not sure why you put the async function after the opening body tag.

Custom image in facebook send dialog?

I am trying to send a facebook private message via facebook send dialog in my facebook app, i have a problem while setting the custom image each time user clicks on it, i am sending the parameters as
send msg
and on the function side,
FB.init({
appId: '<?=$this->facebook->getAppID()?>',
xfbml: true,
cookie: true
});
function send_message(user_id, image_name) {
FB.ui({
to: user_id,
method: 'send',
name: 'The Image',
description: 'Description here',
link: 'https://www.something.com/',
picture: '<?=baseurl()?>imagepath/'+image_name
});
}
It works fine without picture parameter, but all the time it uses default image that facebook automatically pick from my link.
please your kind help will greatly be appreciated!
Using HTTPS protocol in picture link (if you do so), you might cause your problems. Take a look at Images not working in FB.ui

FB.Login not working in Opera Mobile

I have a mobile web site using Facebook Connect to authenticate user. I encountered a problem login with Opera Mobile. I have below javascript to detect login status, but only in Opera Mobile the callback is not firing. Is anyone encountered this problem?
window.fbAsyncInit = function () {
FB.init({
appId: 'xxxx',
channelUrl: 'http://xxxx/channel.html',
status: true,
cookie: true,
xfbml: true
});
FB.Event.subscribe('auth.statusChange', handleStatusChange);
};
function handleStatusChange(response) { // --> NOT FIRE
if (response.authResponse) {
//Login, show Logout button
}
else {
//Show Login button
}
}
Please make sure you put the JS tags and other required HTML in a logical order (if you use an fb-root element put the scripts after it, try putting them inside BODY if they are currently in HEAD). I've seen FB login fail because the tags were in the wrong order, and because some browsers do "speculative parsing" this cause of random cross-browser malfunction may not be immediately obvious. (Besides, you create a race condition that might break in any browser if the network has a hiccup and the timing of loading stuff is unexpected..)
If you still have problems it would be useful to get a link or a demo to look at. We've tested a random page that uses FB Connect and worked fine. Apart from tag order issues I can't guess what might go wrong for you here.
Opera Mobile has new release today (12.10.ADR-1210081231). It solved the Facebook login issue, but there is a minor issue. The Facebook windows will not close automatically after user login.

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/

QUOTA_EXCEEDED_ERR during FB.init

While creating a mobile web app with the Facebook javascript SDK, I have one iphone (4, ios5) that is receiving a QUOTA_EXCEEDED_ERR during FB.init. My FB.init looks like:
var channel = '//'+(window.location.hostname+((~[80,443].indexOf(window.location.port))?'':(':'+window.location.port))+'/channel.html');
var APP_ID = 'MYAPPIDXXX';
alert('before FB.init');
FB.init({
appId: APP_ID,
channelUrl: channel,
status: true,
cookie: true,
xfbml: true,
oauth: true
});
alert('after FB.init');
This error seems to be related to localStorage, however after clearing cache on the phone the error still occurs.
I can reproduce (only on that one phone) with an html page that only has the fb-root element and the '//connect.facebook.net/en_US/all.js' script followed by the script above. I am using the html5 doctype and including the facebook namespace in the html tag. It never reaches the second alert. My channel file exists and is being served correctly.
Any ideas as to why this is happening?
Thanks
Found the answer here:
http://frederictorres.blogspot.com/2011/11/quotaexceedederr-with-safari-mobile.html
Turns out that iphone in question had "Private Browsing" enabled in the Safari settings. You can detect private browsing by trying to set an empty string to local storage and checking for a QUOTA_EXCEEDED_ERR as shown here:
http://m.cg/post/13095478393/detect-private-browsing-mode-in-mobile-safari-on-ios5