The method FB.Event.unsubscribe()
allows you to un-subscribe a callback from any events previously subscribed to using FB.Event.subscribe()
.
FB.Event.unsubscribe(event, callback)
Name | Type | Description |
---|---|---|
|
| The name of the event type you want to unsubscribe from. Matches the [event types shown in |
|
| The callback function that you want to unsubscribe from the provided event type. This method call will fail if an existing Event subscription for this callback did not already exist. |
Unsubscribing the handleResponse
callback from edge.create
:
FB.Event.subscribe('edge.create', handleResponse);
var handleResponse = function(response) {
alert ('You liked the URL: ' + response);
};
FB.Event.unsubscribe('edge.create', handleResponse);