what is facebook app ID?

20,584

It is recommended to use an App Id for every Social Plugin (like the Like Button).

And here´s an overview of how you should implement the Facebook SDK:

https://developers.facebook.com/docs/javascript/quickstart

You better place that FB.Event code right where it says "Additional initialization code..." - Because right now, you are using "FB" when it´s not even initialized.

And this is where you can create an App: https://developers.facebook.com/apps

Share:
20,584
sun
Author by

sun

Learning Web Technology with the help of SO:) I Love movies.

Updated on July 09, 2022

Comments

  • sun
    sun almost 2 years

    Hi i'm trying to place a facebook like button in website With the following code

        <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    
    
    
      FB.Event.subscribe('edge.create',
             function(response) {
                 alert("Thank you for liking my page"); 
             }
        );
    
    
    
    </script>
    
    <div class="fb-like-box" data-href="https://www.facebook.com/mypage" data-width="292" data-show-faces="true" data-stream="true" data-show-border="true" data-header="true"></div>
    

    But the FB.Event function not working when i tested, I think i can use this trigger event only if i use FB.init and running inside fbAsyncInit() function.this came to know by searhing web.

    i don't know these things exactly.Now the problem is Fb.init require appId,channelUrl and few more.I'm confused i didn't created any Application and i'm not creating i'm just trying to place a facebook like button to my website then how come can i provide appId.

    Can anyone explain me about this appId.Does it required to create like button and to create Fb.event when a user likes my page like thanking them or am i using the given code wrongly?

  • andyrandy
    andyrandy over 10 years
    i assume you meant the first link? i fixed it, thanx.
  • KajMagnus
    KajMagnus over 6 years
    Do you know why it's recommended to use an app id? Seems to me the page URL should be enough
  • andyrandy
    andyrandy over 6 years
    earlier you could avoid a specific spam popup with an app id, not sure if it still applies after several years though :)
  • KajMagnus
    KajMagnus over 6 years
    @luschn Ok :- ) Actually I just found some info about the app id, and posted an answer just below.