Has Facebook changed sharer.php no more detailed options?

We open a sharing popup (via window.open) with a url like

https://www.facebook.com/sharer/sharer.php?s=100&p[title]=EXAMPLE&p[summary]=EXAMPLE&p[url]=EXAMPLE&p[images][0]=EXAMPLE 

and to some unknown point in the last month or so, everything was in order.

What is happening now; a pop-up dialog box appears and correctly includes the title, description, image and URL provided by the query string parameters, but when the message is sent, the resulting message on the wall on Facebook is missing the title, description and image, although it is still related correct url.

Does anyone know if there have been recent changes that could suddenly stop this from working?

Prevention of some common answers:

  • "Sharer.php url is out of date" - the use seemed to continue, and it seemed that the consensus was that it was largely considered bonding - I did not see any concrete indication that this should have stopped working suddenly - maybe I missed something

  • "Using the JavaScript SDK / these OG meta tags" is not possible in my specific situation - just believe me ... I can explain if you want REALLY, but it really is not relevant.

  • "Use feed dialog" - not suitable due to lack of support for posting with attachments on FB pages

+97
javascript api php facebook sharing
Jan 06 '14 at
source share
4 answers

Facebook no longer supports user settings in sharer.php

The splitter will no longer accept custom parameters, and pull out the information that appears in the preview that it will appear on facebook as a message from the OG meta tag URL.

Use dialog / channels instead of sharer.php

 https://www.facebook.com/dialog/feed? app_id=145634995501895 &display=popup&caption=An%20example%20caption &link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fdialogs%2F &redirect_uri=https://developers.facebook.com/tools/explorer 

The official response of the fb team

+102
Apr 09 '14 at 17:15
source share

Starting July 18, 2017, Facebook decided to ignore user settings set by users. This choice blocks many of the possibilities offered by this answer, and also breaks the buttons used on several websites.

The quote and hashtag options have been working since December 2018.




Does anyone know if there have been recent changes that could suddenly prevent this from working?

Parameters have changed. Currently, the accepted answer reads:

Facebook no longer supports user settings in sharer.php

But this is not entirely correct. Well, maybe they don’t support or disapprove of them, but you can use custom options if you know the correct names. They include:

  • URL (of course) β†’ u
  • custom image β†’ picture
  • custom title β†’ title
  • custom quote β†’ quote
  • user description β†’ description
  • title (aka site name) β†’ caption

For example, you can share this question with the following URL:

 https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fstackoverflow.com%2Fq%2F20956229%2F1101509&picture=http%3A%2F%2Fwww.applezein.net%2Fwordpress%2Fwp-content%2Fuploads%2F2015%2F03%2Ffacebook-logo.jpg&title=A+nice+question+about+Facebook&quote=Does+anyone+know+if+there+have+been+recent+changes+which+could+have+suddenly+stopped+this+from+working%3F&description=Apparently%2C+the+accepted+answer+is+not+correct. 

Try!

I created a tool that facilitates sharing URLs on Facebook with custom parameters. You can use it to generate a link to sharer.php , just click the button and copy the URL from the tab that opens.

+91
Oct 29 '16 at 13:12
source share

Your problem is caused by the lack of OpenGraph markers, as you say that for some reason you are not implementing.

For you, the only solution is to use the PHP Facebook API .

  • You must first create the application in your facebook account.
  • When creating the application, you will have two key data for your code:

     YOUR_APP_ID YOUR_APP_SECRET 
  • Download the PHP SDK from here .

  • You can start with this code to share content from your site:

     <?php // Remember to copy files from the SDK src/ directory to a // directory in your application on the server, such as php-sdk/ require_once('php-sdk/facebook.php'); $config = array( 'appId' => 'YOUR_APP_ID', 'secret' => 'YOUR_APP_SECRET', 'allowSignedRequest' => false // optional but should be set to false for non-canvas apps ); $facebook = new Facebook($config); $user_id = $facebook->getUser(); ?> <html> <head></head> <body> <?php if($user_id) { // We have a user ID, so probably a logged in user. // If not, we'll get an exception, which we handle below. try { $ret_obj = $facebook->api('/me/feed', 'POST', array( 'link' => 'www.example.com', 'message' => 'Posting with the PHP SDK!' )); echo '<pre>Post ID: ' . $ret_obj['id'] . '</pre>'; // Give the user a logout link echo '<br /><a href="' . $facebook->getLogoutUrl() . '">logout</a>'; } catch(FacebookApiException $e) { // If the user is logged out, you can have a // user ID even though the access token is invalid. // In this case, we'll get an exception, so we'll // just ask the user to login again here. $login_url = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' )); echo 'Please <a href="' . $login_url . '">login.</a>'; error_log($e->getType()); error_log($e->getMessage()); } } else { // No user, so print a link for the user to login // To post to a user wall, we need publish_stream permission // We'll use the current URL as the redirect_uri, so we don't // need to specify it here. $login_url = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' ) ); echo 'Please <a href="' . $login_url . '">login.</a>'; } ?> </body> </html> 

You can find more examples on the Facebook developers website:

https://developers.facebook.com/docs/reference/php

+3
Feb 28 '14 at
source share

I am browsing your used URL:

 https://www.facebook.com/sharer/sharer.php?s=100&p[title]=EXAMPLE&p[summary]=EXAMPLE&p[url]=EXAMPLE&p[images][0]=EXAMPLE 

and look at this:

  • Recipient URL does not match.
  • Lines are in a different order. (I do not know if this affects).

I use this URL string:

 http://www.facebook.com/sharer.php?s=100&p[url]=http://www.example.com/&p[images][0]=/images/image.jpg&p[title]=Title&p[summary]=Summary 

In the "title" and "summary" sections, I use the php urlencode(); function urlencode(); in the following way:

 <?php echo urlencode($detail->title); ?> 

And works great for me.

+1
Feb 28 '14 at 1:43
source share



All Articles