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

别等时光非礼了梦想. 提交于 2019-12-02 17:38:32

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
Graham P Heath

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!