---
schema_version: "1"
id: 33074c5dbfd1ae82c3203afe634b7f7cba44d51352819faaf61bf2da8b1dfa31
title: Unsubscribing from a Canvas App Event
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/using/events/canvas-app-event-unsubscribe-code-example.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-event-unsubscribe-code-example.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: af8a1cb1578f1734e64c9d3e765a84091579f5c93a98da75084537172b58b113
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Unsubscribing from a Canvas App Event

## Unsubscribing from a Custom Event

The following code example shows how to call the `unsubscribe` method to unsubscribe from a canvas app event.

<!-- otherprops: set_clipboard -->
```java
// Unsubscribe from a custom event.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.unsubscribe(sr.client, {name : "mynamespace.statusChanged"});
});
```

## Unsubscribing from Multiple Custom Events

The following code example shows how to call the `unsubscribe` method to unsubscribe from multiple canvas app events. The events you subscribe to can be in different namespaces or might not have a namespace.

<!-- otherprops: set_clipboard -->
```java
// Unsubscribe from multiple events.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.unsubscribe(sr.client, ['mynamespace.statusChanged', "anothernamespace.tripCancelled"]);
});
```

**See Also**  


-   [Implementing Canvas App Events](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-events.md)
-   [Subscribing to a Canvas App Event](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-event-subscribe-code-example.md)
-   [Subscribing to Parent Events](https://developer.salesforce.com/docs/platform/canvas-framework/resizing/canvas-app-subscribe-code-example.md)

