4

Is it possible to use FB share plugin without APP ID? If I use HTML5 code then the console logs an error FB.getLoginStatus() called before calling FB.init(). To use HTML 5 FB like is it necessary to have an APP ID?

Thank you

1Mayur
  • 3,419
  • 5
  • 40
  • 64

2 Answers2

9

Here i am sharing what i did to share post on fb wall, In this way you do not need to use appId. Just put this code in your HTML page where you want link to share...

<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php?u={$url}&media={$imgPath}&description={$desc}" class="joinFB">Share Your Advertise</a>

URL parameters are as explained below,

u : url or link you want to user to go when he clicks on your wall post,

media : full image path,make sure that image is available on given path,it will accept one image only

description : a short description that you want to show on wall

it will look like this image when you click on the share button

It will also ask you to write some data which will be displayed above your post. Description passed in url will be displayed in right side of your image.

Please note that i had passed $url,$desc,$imgPath variables as per my need. The above code is in smarty-php, so change it as per your requirement.

Hope this becomes helpful to you.

Kaushal Bhatt
  • 346
  • 1
  • 10
  • this is not valid anymore – lakshman Nov 05 '15 at 07:04
  • @lakshman the image and description variables don't seem to work (they come from a FB scrape of the page) but the method in general still works. You can provide a link to `http://www.facebook.com/sharer.php?u=http://www.example.com` and the user is prompted to share that URL on Facebook. – Alan H Mar 18 '16 at 11:53
  • Sharer now don't support parameters (title, summary, etc.). More info in https://stackoverflow.com/questions/22652041/how-to-pass-parameter-like-title-summary-and-image-in-facebook-sharer-url and https://stackoverflow.com/questions/11616697/how-to-use-og-meta-tag-for-facebook-share – dpinya Jun 08 '17 at 15:03
0

Yes you need an app id. You can try to inject your own code into the DOM of the user when using facebook and call functions in their javascript... But I doubt many users will actiually use an "app" that works this way.

Flunk
  • 283
  • 2
  • 4