PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, March 10, 2022

[FIXED] Trouble linking to images on localhost in a post from a Facebook application

 March 10, 2022     facebook, localhost, mamp, publish     No comments   

Issue

I use the following code to publish to a users wall in my Facebook app I have just started:

    FB.ui(
{
 method: 'feed',
 name: 'Facebook Dialogs',
 link: 'http://developers.facebook.com/docs/reference/dialogs/',
 picture: 'http://localhost:8888/project_images/110/110.png',
 caption: 'Reference Documentation',
 description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
 message: 'Facebook Dialogs are easy!'
},
function(response) {
 if (response && response.post_id) {
   alert('Post was published.');
 } else {
   alert('Post was not published.');
 }
}
);

Sadly this does not display the image eventhough when I enter: http://localhost:8888/project_images/110/110.png into my browser the image displays without an issue. Also, when I use the default from the example: http://fbrell.com/f8.jpg as the picture: parameter the image shows up fine. Is this not working because of the localhost? I am running localhost off MAMP.


Solution

I ran into this issue as well. I think it is because Facebook attempts to fetch the image, and cannot get to localhost.



Answered By - Leo Romanovsky
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing