티스토리 뷰

페이스북 developer 에서 app을 새로 생성하면 주는 key를 입력해주면 된다.

 

You wanted to have Facebook Like Button or Facebook Like Box and other Facebook social plugins on your website. You copy pasted to code Facebook generated for you on your web pages. If you do not have an App ID when you copied this, chances are the Facebook script will complain in your Web Browser’s console (e.g Firebug Console).

Invalid App Id: Must be a number or numeric string representing the application id.
FB.getLoginStatus() called before calling FB.init().
 
all.js#xfbml=1 (line 56)

To fix this issue, just do a “Create New App” in the Apps section in Facebook. And then go back to the Facebook Social Plugins page, pick a plugin, and regenerate the code for it.

Your Facebook plugin code before having an App ID:

<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'));</script>

After you have assigned an App to the plugin

<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&appId=<your-16-digit-app-id>";  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Notice the difference in the highlighted code? Let me know if this solved your problem in the comment area.

댓글
댓글쓰기 폼
공지사항
Total
211,524
Today
57
Yesterday
143
링크
TAG
more
«   2018/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
글 보관함