facebook share not working via mobile - facebook

I want to share a link on facebook ,
Click to Share
Its working perfectly for web, but when I browse via any mobile(android,ios) it redirect to fb timeline but doesnot show/post anything .

<html>
Click here
<script>
function test(){
window.open("http://www.facebook.com/dialog/feed?app_id=YOURappID&link=linkToYourApps&caption=Watch%20our%20Ice%20Breaking%20Machine%20on%20You%20Tube%20%20%20%20%20Discover=yourComments&description=YourDescription&redirect_uri=redirect_url","_parent");
}

add this ?m2w parameter to sharer.php.
In your case:
http://www.facebook.com/sharer.php?m2w&s=100&p[url]=ENCODEDURL&p[title]=encoded TITLE&p[summary]=encoded description&p[images][0]=encoded

Related

How to open the native Facebook app from a react app link?

In my react web app I have a link to share a website url on Facebook:
<Link href={`https://www.facebook.com/sharer/sharer.php?u=${this.props.shareUrl}`}>
Share on Facebook
I could also use a plain html link like so
<a href={`https://www.facebook.com/sharer/sharer.php?u=${this.props.shareUrl}`}>Share on Facebook</a>
When this is clicked Safari is launched and the Facebook web page is displayed.
What would I need to do to get the native Facebook ios or android app to launch (instead of a browser) if it is installed? Could I carry on using this link or would I need to use a share button or install the Fb SDK?
Try this one to open a Facebook app from URL. It works for me.
Linking.openURL("fb://facewebmodal/f?href=https://www.facebook.com/FixadorPT/");

Share url in facebook messenger from web

I would like to share an url from a website (using mobile device) to facebook messenger app.
I tried to use:
FB.ui({
method: 'send',
link: 'http://www.nytimes.com/interactive/2015/04/15/travel/europe-favorite-streets.html',
});
But that does nothing on the mobile device. I also tried:
fb://messaging/compose/new
That did open the message dialog but I can't find an URI for sharing an url.
I wonder if this is even possible?
This is what you are looking for:
Link:
Send In Messenger
JavaScript:
window.open('fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=' + encodeURIComponent(app_id));
Please note: This will only work on mobile devices. For more information see here:
https://developers.facebook.com/docs/sharing/messenger/web
You can use the Send Dialog, which is not supported on mobile: https://developers.facebook.com/docs/sharing/reference/send-dialog#examples
Alternative for mobile: https://developers.facebook.com/docs/sharing/messenger
FWIW the following link, clicked on a desktop computer, will allow your user to share the link via Facebook Messenger. You have to replace app-id with the app-id of an arbitrary app of yours, created at developer.faceboook.com:
http://www.facebook.com/dialog/send?app_id=[app-id]&link=https://stackoverflow.com&redirect_uri=https://stackoverflow.com
<a href="fb-messenger://share/?link=http://url-you-want-to-share.com&app_id=your-app-id-here">
...
</a>
Does not seem to work on desktop, but I could be wrong.
Source: https://developers.facebook.com/docs/sharing/messenger

Facebook mobile web returns 'Your link could not be found' when sharing a URL

When users try to share a URL on facebook mobile web, sometimes the page returns the following message: 'Your link could not be found' and a text input to manually insert the URL
Sharing URL that works:
https://m.facebook.com/sharer.php?u=http://dishenvy.com/dish/pollo-garnachas-gran-electrica-brooklyn
Sharing URL that doesn't work:
https://m.facebook.com/sharer.php?u=http://dishenvy.com/dish/samgyupsal-hahm-ji-bach-new-york-
Code I'm using:
<a class="fb_share" name="fb_share" type="icon" share_url="<?php echo urldecode($shareUrl) ?>">
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
Make sure the url you pass is accessible to Facebook. Not sure why, but their mobile site seems to validate the url but their non-mobile site does not seem to care. If you have code generating the link you pass to facebook and the host corresponds to a server behind a firewall or private network (such as a test or dev server), this error will often happen.
According to the debugger the two url example that you posted work the same:
First
Second
So I don't know how to help you with that.
What I can tell you though is that you are using a deprecated api.
The facebook "sharer" is no longer supported as it states here:
The Share button has been deprecated in favor of the Like button, and
will no longer be supported. Please use the Like button whenever
possible to drive maximum traffic to your apps.
And here:
What happened to the old Share button?
We deprecated the Share Button when we launched the Like button,
because the Like button improves clickthrough rates by allowing users
to connect with one click, and by allowing them to see which of their
friends have already connected.
That may be a cause for the inconsistency you are experiencing.
My advise to you is to stop using this deprecated api and move to the Like button.
I think facebook check your sharing page found or not on the server. Your first url found on the server (It means first url return the page). Second url doesn't return the page. The second url return the empty page for this reason facebook return this message. 'Your link could not be found'
Click the link :
http://dishenvy.com/dish/pollo-garnachas-gran-electrica-brooklyn = Page found
http://dishenvy.com/dish/samgyupsal-hahm-ji-bach-new-york- = Page not found
So share correct url on the facebook
https://m.facebook.com/sharer.php?m2w&u=http://dishenvy.com/dish/samgyupsal-hahm-ji-bach-new-york-
For mobile view you want to add m2w to the url.

How to link to external website from the app icons below the Timeline on Facebook?

How do you make those icon apps below your timeline so that when you click on one of them it opens a new window (or the same window) and goes to an external website?
I think this is the app you might be looking for
https://www.facebook.com/iframehost?sk=app_208195102528120
i don't think you can do that. But, you can make it so that when you click them, they will go to the app page as normal, and in that app page you can put a javascript code to redirect that page:
<script type="text/javascript">
top.window.location.replace('NEWLOCATION');
</script>
It will redirect the page (one which facebook is in)

Link to a facebook application from a facebook page does not work?

I have a ready facebook application that should be linked to a facebook page. I am trying to link the canvas url of my application to a button in the page with the help of javascript by calling:
function onBtnClick() { window.location = "http://apps.facebook.com/CANVAS_URL/"; }
When I click the button that is supposed to take me to the app I get only an empty page with a blue box and "Facebook" string inside it (pretty much looking like the facebook logo)
This box is a link to my application and if clicked takes me to http://apps.facebook.com/CANVAS_URL/
The same problem occurs in the application, where I try to link the facebook page. The link there is a regular <a> tag.
Do you have any ideas how to redirect to an app without this additional "Facebook" page?
Thanks in advance,
Martin
Use this instead:
top.location.href = "http://apps.facebook.com/CANVAS_URL/";
You need the upper frame (Facebook) to redirect.
If using a simple <a> html link, try target="_top"