Cancel Event Subscription

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)

Parameters

NameTypeDescription

event

enum{}

The name of the event type you want to unsubscribe from. Matches the [event types shown in .Event.subscribe().

callback

function

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.

Example

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);