Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook share on mobile device

I am using this URL to share the URL, title, description and image to Facebook:

http://www.facebook.com/sharer.php?&s=100&p[url]=ENCODEDURL&p[title]=encoded TITLE&p[summary]=encoded description&p[images][0]=encoded

It works fine in desktop site, but doesn't work in the mobile site. The mobile site changes the URL to m.facebook.come/sharer.php?....

I changed the Facebook URL to m.facebook.com/sharer.php?... and passed the same parameters like title, description and image but it still doesn't work.

After searching on Google, I have come across an article that explains that we can send two parameters in the mobile version of Facebook: u for URL and t for title.

What should I do to have a similar result for users that navigate to Facebook either using a desktop or mobile device?

like image 843
user2632021 Avatar asked Jul 29 '13 22:07

user2632021


2 Answers

I just ran into this same problem, and my only solution was to force mobile users to use the desktop version of sharer.php. It looks like ass on mobiles but it functions as expected and was the best way I could find to not completely hose sharing in my app. In the end, my client would rather have working, less-aesthetically pleasing sharing than a proper mobile sharing page that was broken.

To do this, all you have to do is add a ?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

like image 87
Scott Avatar answered Oct 26 '22 18:10

Scott


You can use mobile version of sharer.php as there isn't any alternatives.

http://m.facebook.com/sharer.php?u=<urlencoded url>

For example:

http://m.facebook.com/sharer.php?u=http://www.example.com

Please see this question and answers too.Facebook and twitter share for mobile web

like image 43
Surabhil Sergy Avatar answered Oct 26 '22 17:10

Surabhil Sergy