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 

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

Arguments 

NameTypeDescription
callbackfunctionA function called when the removal of the push notification listener completes.

Sample Code–Visualforce 

1<apex:page standardController="Case">
2
3     <A HREF="#" onClick="testRemovePushNotification();return false">
4         Click here to remove push notification</A>
5
6<apex:includeScript value="/support/console/68.0/integration.js"/>
7    <script type="text/javascript">
8
9        function testRemovePushNotification() {
10            sforce.console.removePushNotificationListener(removeSuccess);
11         }
12        var removeSuccess = function removeSuccess(result) {
13            //Report whether removing the push notification listener is successful
14            if (result.success == true) {
15                alert('Removing push notification was successful');
16            } else {
17                alert('Removing push notification wasn't successful');
18            }
19         };
20    </script>
21</apex:page>

Response 

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

NameTypeDescription
successbooleantrue if removing the push notification listener was successful; false if removing the push notification listener wasn’t successful.