Goles
Goles

Reputation: 11799

FB.Event.subscribe not working for method: 'send'

I'm using FB.ui to create a send dialog... I'm trying to get a callback after the user sent the message, but it's not working for some reason.

I tried to use FB.event.subscribe

   FB.ui({                                                                                                                                                                   
     method: 'send',                                                                                                                                                         
     name: 'You\'re invited to join!',                                                                                                                          
     link: 'http://anexample.com',                                                                                                                                                              
   }); 

   FB.Event.subscribe('message.send',                                                                                                                                          
      function(response){                                                                                                                                                      
       alert('You sent a message from the URL ' + response);                                                                                                                                 
     }                                                                                                                                                                         
  );

Could anyone tell me what could be the problem with the subscribe ? The send works just fine.

Upvotes: 1

Views: 930

Answers (1)

Yan Berk
Yan Berk

Reputation: 14428

Use the following callback:

FB.ui({ 
       method:'send',
       name: 'You\'re invited to join!',                                    
       link: 'http://anexample.com',
    },
    function(response) {
      //callback
    }
); 

The callback you are using is for the send button.

Upvotes: 2

Related Questions