WX Fox
WX Fox

Reputation: 33

Notifications with Facebook Comment Box

I've been reading through other related questions here, but I think they are even too advanced for where I am at with Facebook's coding and such...

I want to have a Facebook Comment box on my website. That is no problem and it works fine. I also want to be notified, on Facebook, when someone leaves a comment. I've tried numerous different things with the comment.create but I really don't have a clue what I am doing.

Can someone take me through this step-by-step and help me understand what I need to do? Here is what I've got:

<body>
  <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=362160727158879";
    fjs.parentNode.insertBefore(js, fjs);
    }
  </script>

  <div class="fb-comments" data-href="{site name}" data-num-posts="10" data-width="650" notify="true"></div>

Upvotes: 1

Views: 3153

Answers (2)

Dirk Zaal
Dirk Zaal

Reputation: 324

What you need is just add a friend in the app settings on the page as moderator. He/she will get notification in their Facebook profile each time someone is commenting on your website.

Also, this tool is very handy and to be Favorited for people with developer accounts: https://developers.facebook.com/tools/comments

Upvotes: 0

Henrique Araujo
Henrique Araujo

Reputation: 21

WX, I have a Classifieds app on Facebook. I needed to create some notification to the owner of the advertisement also. I solved that with a simple way, after a comment I manipulate the response from FB with Ajax and Jquery:

FB.Event.subscribe('comment.create', function(response) {

    //Send an email with ajax

    $.ajax({
            type: "POST",
            url: "sendcommentemail.php?",
            data: "urlofpage=", 
            beforeSend:  function() {
                $('#loading').show();

        },
            success: function(html){
                $('#loading').hide();
        },
            error: function(html){
        }
    });
});

good luck!

Upvotes: 2

Related Questions