removePushNotificationListener()

Removes a listener that gets added for a push notification. This method is only available in API version 26.0 or later.

For more information on push notifications, see Methods for Push Notifications.

Syntax

sforce.console.removePushNotificationListener((optional) callback:Function )

Arguments

Name Type Description
callback function A function called when the removal of the push notification listener completes.

Sample Code–Visualforce

<apex:page standardController="Case">

     <A HREF="#" onClick="testRemovePushNotification();return false">
         Click here to remove push notification</A>

<apex:includeScript value="/support/console/63.0/integration.js"/>
    <script type="text/javascript">

        function testRemovePushNotification() {
            sforce.console.removePushNotificationListener(removeSuccess);
         }
        var removeSuccess = function removeSuccess(result) {
            //Report whether removing the push notification listener is successful
            if (result.success == true) {
                alert('Removing push notification was successful');
            } else {
                alert('Removing push notification wasn't successful');
            }
         };
    </script>
</apex:page>

Response

This method is asynchronous so it returns its response in an object in a callback method.

Name Type Description
success boolean true if removing the push notification listener was successful; false if removing the push notification listener wasn’t successful.