---
source_url: https://www.pubnub.com/docs/sdks/vue/api-reference/mobile-push
title: Mobile Push Notifications API for Vue SDK
updated_at: 2026-05-25T11:29:41.525Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Mobile Push Notifications API for Vue SDK

The Mobile Push Notifications feature connects native PubNub publishing to third-party push services. Supported services include Google Android FCM (Firebase Cloud Messaging) and Apple iOS APNs (Apple Push Notification service).

To learn more, read about [Mobile Push Notifications](https://www.pubnub.com/docs/general/push/send).

## Add a device to a push notifications channel

:::note Requires Mobile Push Notifications add-on
Enable Mobile Push Notifications for your key in the [Admin Portal](https://admin.pubnub.com/). See how to [enable add-on features](https://support.pubnub.com/hc/en-us/articles/360051974791-How-do-I-enable-add-on-features-for-my-keys-).
:::

Enable mobile push notifications on a set of channels.

### Method(s)

Use the following method(s) in the Vue SDK:

```javascript
pubnub.push.addChannels({Array channels, String device, String pushGateway, String environment, String topic},Function callback)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| channels | Array | Yes |  | Channels to enable for push notifications. |
| device | String | Yes |  | Device token. |
| pushGateway | String | Yes |  | Accepted values: `apns`, `apns2`, `gcm`. |
| environment | String | Optional | `development` | APNs environment. Required if `pushGateway` is `apns2`. |
| topic | String | Optional |  | APNs topic (bundle identifier). Required if `pushGateway` is `apns2`. |
| callback | Function | Optional |  | Callback on success or error. |

### Sample code

#### Add device to channel

```javascript
import PubNubVue from 'pubnub-vue';

const pubnub = PubNubVue.getInstance();

pubnub.push.addChannels(
    {
        channels: ['a', 'b'],
        device: 'niceDevice',
        pushGateway: 'apns' // apns, gcm,
    },
    function(status) {
        if (status.error) {
            console.log("operation failed w/ error:", status);
        } else {
            console.log("operation done!");
        }
    }
);
```

### Response

```javascript
{
    error: false,
    operation: 'PNPushNotificationEnabledChannelsOperation',
    statusCode: 200
}
```

## List push notifications channels for a device

:::note Requires Mobile Push Notifications add-on
Enable Mobile Push Notifications for your key in the [Admin Portal](https://admin.pubnub.com/). See how to [enable add-on features](https://support.pubnub.com/hc/en-us/articles/360051974791-How-do-I-enable-add-on-features-for-my-keys-).
:::

List channels that have push notifications enabled for the specified device token.

### Method(s)

Use the following method(s) in the Vue SDK:

```javascript
pubnub.push.listChannels({String device, String pushGateway, String environment, String topic},Function callback)
```

| Parameter | Description |
| --- | --- |
| `device` *Type: StringDefault: n/a | Device token. |
| `pushGateway` *Type: StringDefault: n/a | Accepted values: `apns`, `apns2`, `gcm`. |
| `environment`Type: StringDefault: `development` | APNs environment. Required if `pushGateway` is `apns2`. |
| `topic`Type: StringDefault: n/a | APNs topic (bundle identifier). Required if `pushGateway` is `apns2`. |
| `callback`Type: FunctionDefault: n/a | Callback on success or error. |

### Sample code

#### List channels for device

```javascript
import PubNubVue from 'pubnub-vue';

const pubnub = PubNubVue.getInstance();

pubnub.push.listChannels(
    {
        device: 'niceDevice',
        pushGateway: 'apns' // apns, gcm
    },
    function(status, response) {
        if (status.error) {
            console.log("operation failed w/ error:", status);
            return;
        }

        console.log("listing push channel for device");
        response.channels.forEach( function(channel) {
            console.log(channel);
        });
    }
);
```

### Response

```javascript
// Example of status
{
    error: false,
    operation: 'PNPushNotificationEnabledChannelsOperation',
    statusCode: 200
}

// Example of response
{
    channels: [ 'a', 'b' ]
}
```

## Remove a device from push notifications channels

:::note Requires Mobile Push Notifications add-on
Enable Mobile Push Notifications for your key in the [Admin Portal](https://admin.pubnub.com/). See how to [enable add-on features](https://support.pubnub.com/hc/en-us/articles/360051974791-How-do-I-enable-add-on-features-for-my-keys-).
:::

Disable mobile push notifications on a set of channels.

### Method(s)

Use the following method(s) in the Vue SDK:

```javascript
pubnub.push.removeChannels({Array channels, String device, String pushGateway, String environment, String topic},Function callback)
```

| Parameter | Description |
| --- | --- |
| `channels` *Type: ArrayDefault: n/a | Channels to disable for push notifications. |
| `device` *Type: StringDefault: n/a | Device token. |
| `pushGateway` *Type: StringDefault: n/a | Accepted values: `apns`, `apns2`, `gcm`. |
| `environment`Type: StringDefault: `development` | APNs environment. Required if `pushGateway` is `apns2`. |
| `topic`Type: StringDefault: n/a | APNs topic (bundle identifier). Required if `pushGateway` is `apns2`. |
| `callback`Type: FunctionDefault: n/a | Callback on success or error. |

### Sample code

#### Remove device from channel

```javascript
import PubNubVue from 'pubnub-vue';

const pubnub = PubNubVue.getInstance();

pubnub.push.removeChannels(
    {
        channels: ['a', 'b'],
        device: 'niceDevice',
        pushGateway: 'apns' // apns, gcm
    },
    function(status) {
        if (status.error) {
            console.log("operation failed w/ error:", status);
        } else {
            console.log("operation done!");
        }
    }
);
```

### Response

```javascript
{
    error: false,
    operation: 'PNPushNotificationEnabledChannelsOperation',
    statusCode: 200
}
```

## Remove a device from all push notifications channels

:::note Requires Mobile Push Notifications add-on
Enable Mobile Push Notifications for your key in the [Admin Portal](https://admin.pubnub.com/). See how to [enable add-on features](https://support.pubnub.com/hc/en-us/articles/360051974791-How-do-I-enable-add-on-features-for-my-keys-).
:::

Disable mobile push notifications from all channels registered with the specified device token.

### Method(s)

Use the following method(s) in the Vue SDK:

```javascript
pubnub.push.deleteDevice({String device, String pushGateway, String environment, String topic},Function callback)
```

| Parameter | Description |
| --- | --- |
| `device` *Type: StringDefault: n/a | Device token. |
| `pushGateway` *Type: StringDefault: n/a | Accepted values: `apns`, `apns2`, `gcm`. |
| `environment`Type: StringDefault: `development` | APNs environment. Required if `pushGateway` is `apns2`. |
| `topic`Type: StringDefault: n/a | APNs topic (bundle identifier). Required if `pushGateway` is `apns2`. |
| `callback`Type: FunctionDefault: n/a | Callback on success or error. |

### Sample code

#### Remove all mobile push notifications

```javascript
import PubNubVue from 'pubnub-vue';

const pubnub = PubNubVue.getInstance();

pubnub.push.deleteDevice(
    {
        device: 'niceDevice',
        pushGateway: 'apns' // apns, gcm
    },
    function(status) {
        if (status.error) {
            console.log("operation failed w/ error:", status);
        } else {
            console.log("operation done!");
        }
    }
);
```

### Response

```javascript
{
    error: false,
    operation: 'PNPushNotificationEnabledChannelsOperation',
    statusCode: 200
}
```

## Terms in this document

* **PubNub** - PubNub is a real-time messaging platform that provides APIs and SDKs for building scalable applications. It handles the complex infrastructure of real-time communication, including: Message delivery and persistence, Presence detection, Access control, Push notifications, File sharing, Serverless processing with Functions and Events & Actions, Analytics and monitoring with BizOps Workspace, AI-powered insights with Illuminate.
