Joka
Joka

Reputation: 61

fb.event.subscribe and facebook comment box

Context:

I have a facebook app that is using the facebook comments box.

In this app a user can create an item for sale.

The item for sale is available at facebook_url_for_the_app/item/itemnumber.

When the user that created the item for sale (or any other user) visualizes the page for the created item, the facebook comments box is available.

Desired function:

Currently, if any user writes a comment the user that created it will only know about it if he visits the page.

My Idea to solve the problem:

I have looked into FB.Event.subscribe('comments.create') but there isn't a field to identify a user other than the admin of the application.

Question:

How can I tell my app to create a subscribe to any comments created at the item's page, facebook_url_for_the_app/item/itemnumber.

Upvotes: 6

Views: 2953

Answers (3)

Jessie Frazelle
Jessie Frazelle

Reputation: 635

You may want to also make them a moderator of the comment box by adding the metatag

<meta property="fb:admins" content="{THEIR_FACEBOOK_USER_ID}"/> 

to the head.

Upvotes: 0

Wasim
Wasim

Reputation: 896

Joka: I guess this link will help you out in some way. Here u can subscribe for the event and use it accordingly to notify the user.

click here to view the page

Upvotes: 0

eosgood
eosgood

Reputation: 308

Joka,

If you subscribe to comment.create event

<script>
  FB.Event.subscribe('comment.create', function(resp) {
    Log.info('Comment was added', resp);
    // add code here to id the user e.g FB.api('/me', function(response) {})
  });
</script>

You can then add code to do something with the uid returned by the FB.api call

Upvotes: 2

Related Questions