Can't use facebook sharer.php custom parameters in mobile sites - facebook

I own a jQuery mobile website. There i using facebook share option with custom parameters to add title, description, image with link
Like below,
https://www.facebook.com/sharer/sharer.php?s=100&p%5Burl%5D=http%3A%2F%2Fgoogle%2F&p%5Bimages%5D%5B0%5D=https://www.google.com/images/srpr/logo3w.png&p%5Btitle%5D=My%20own%20title&p%5Bsummary%5D=My%20own%20description
But when i try the same link to mobile, it will redirect to
http://m.facebook.com/sharer.php?s=100&p%5Burl%5D=http%3A%2F%2Fgoogle%2F&p%5Bimages%5D%5B0%5D=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo3w.png&p%5Btitle%5D=My+own+title&p%5Bsummary%5D=My+own+description&_rdr
which means, it will add m.facebook at the start of share url. so it wont work with custom title, desc, image & link.
Anyway to fix this? or how to force mobile web to not to go with m.facebook.com ?

You can prevent Facebook from going to the mobile site by adding a ?m2w parameter to the URL. Then, sharer.php works like usual.
e.g.
https://www.facebook.com/sharer/sharer.php?m2w&s=100.... (etc)
Looks kind of bad though, looking for a better answer.
Edit: Sharer.php has been deprecated, see Felix' answer below.

sharer.php has now been deprecated.
https://developers.facebook.com/bugs/252983554810810/
The new method is to use the share dialog:
https://developers.facebook.com/docs/sharing/reference/share-dialog
e.g.
https://www.facebook.com/dialog/share?
app_id=145634995501895
&display=popup
&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
&redirect_uri=https://developers.facebook.com/tools/explorer

url for mobile is supported as u, and title is supported as t
http://m.facebook.com/sharer.php?u=<urlencoded url>&t=<urlencoded title>
source

Use the mobile url to fix the problem in mobile devices, Facebook will redirect to the share dialog in desktop.
http://m.facebook.com/sharer.php?u=<urlencoded url>
Here is an example:
https://careers-hangarcr.herokuapp.com/job/apply/55c277c0fb8b040300622602

Related

Facebook Open Graph: URL to use for sharing?

I am creating a customised Facebook share button. The idea is upon clicking on the Facebook share button, it will pick up the meta tags on the page and prefill the share information with a title, description and image that have been curated.
What URL should I be using for the button?
There is https://www.facebook.com/dialog/share
and https://www.facebook.com/sharer/sharer.php
I heard the latter has been deprecated? And you can append a whole bunch of information to the URL as well?
I can't quite figure that out.
sharer.php is not deprecated. It was, for some months, but you can definitely use it. The benefit of using sharer.php is that you don´t need to create an App. It´s the easiest way to implement sharing.
Keep in mind that sharer.php ONLY takes the URL as parameter, everything else will get loaded from the Open Graph tags.
For example:
https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffacebook.com%2F

Direct link to Facebook mobile site using pageID

graph.facebook.com/cocacola will tell you that the id for the cocacola page is 40796308305.
You can get to the cocacola page using either www.facebook.com/cocacola or www.facebook.com/40796308305.
However, to get to the mobile facebook site m.facebook.com/cocacola works, m.facebook.com/40796308305 doesn't.
For reasons I won't go into I have the pageID, not the vanity url and I need to link to the mobile site.
Specifically, I'd like to link to the equivalent of m.facebook.com/cocacola?v=feed to link to the wall instead of info.
So, I either need a way to link to a mobile page using the page id or a way to make the regular www link redirect to the mobile wall instead of the info page.
You may need to create (or discover the already created) proper "name" ID and use that together with the pageID as your landing page, for example, mine works as follows:
http://m.facebook.com/pages/BCmoney-MobileTV/190267987672979
But using just my pageID it does not:
http://m.facebook.com/pages/190267987672979
In addition, you could use the Graph API to deduce the "vanity URL" as you refer to it:
http://graph.facebook.com/40796308305
Looks like this is the page you're looking for:
http://m.facebook.com/pages/Coca-Cola/40796308305
The simplest way I found to get the mobile version of any Facebook page is to go the desktop version of the page on your browser of choice and then replace the www with m and press Enter. The Facebook Mobile Web version of the page loads in your browser.
I had the same problem with a link on a website, but I don't want everyone to go to the mobile site, just those on mobile devices.
The solution was to add ?v=wall to it. It works for both desktop and mobile now. Here is what my link looks like now: https://www.facebook.com/pages/Virginia-B-Andes-Volunteer-Community-Clinic/153180528039538?v=wall

Facebook share URL code not working

I realize Share has been deprecated by Facebook, but this is still posted on their documentation:
https://www.facebook.com/sharer.php?u=[url to share]&t=[title of content]
However, the title won't change no matter what I do -- including adding the "og:title" meta and changing the actual title of the page.
Any suggestions on how I can make it possible for people to share my page with a suggested message? thanks.
I would encourage you to use the Facebook Javascript SDK, this will give you much more flexibility with what you share.
https://developers.facebook.com/docs/reference/dialogs/feed/

Facebook Page link to Photos?

Is there a way to link to the facebook photos tab of a Page via an iFrame loaded from a custom App (tab)? If I try to link to num?sk=photos, it gives me the "Go to Facebook.com" loaded in that iframe. I pretty much want a redirect.
Is that possible? Or does FB block link-ins like that?
Let me know,
Thanks!
I've been using javascript to set window.top.location.href = url;, but after reading Igy's comment, I think I'll be switching to target = _top
I think you should check out facebook developer page.
You can use GRAPH API to access photos, photo albums, profile pictures unless any user has different privacy setting.
You might want to check out GRAPH API for that, I hope it might help you to get started.

fb:google-analytics , does it work for you?

I have a Facebook fan page, and some tabs in it. one of which is a static fbml one which besides having and img tag has the following
<fb:google-analytics uacct="UA-19191919-4" />
problem is.... Facebook ignores this tag and I see no evidence of Google analytics code being executed...
any ideas ?
Use an iframe for your apps with regular analytic code. Facebook doesn't use FBML anymore.