---
source_url: https://www.pubnub.com/docs/sdks/angular/api-reference/mobile-push
title: Mobile Push Notifications API for AngularJs SDK
updated_at: 2026-05-18T12:49:00.720Z
---

> 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 AngularJs 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).

By using the Mobile Push Notifications feature, developers can eliminate the need for developing, configuring, and maintaining additional server-side components for third-party push notification providers.

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

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

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| channels | Array | Yes |  | Channels to enable for push notifications. |
| device | String | Yes |  | Device ID (push token). |
| pushGateway | String | Yes |  | `apns` or `gcm`. |
| callback | Function | Optional |  | Callback invoked on completion. |

### Sample code

```javascript
Pubnub.push.addChannels(
    {
        channels: ['my_chat'],
        device: 'A655FBA9931AB',
        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-).
:::

Get all channels with push notifications for the specified push token.

### Method(s)

```javascript
Pubnub.push.listChannels({String device, String pushGateway},Function callback)
```

| Parameter | Description |
| --- | --- |
| `device` *Type: String | Device ID (push token). |
| `pushGateway` *Type: String | `apns` or `gcm`. |
| `callback`Type: Function | Callback invoked on completion. |

### Sample code

```javascript
Pubnub.push.listChannels(
    {
        device: 'A655FBA9931AB',
        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 push notifications on selected channels.

### Method(s)

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

| Parameter | Description |
| --- | --- |
| `channels` *Type: Array | Channels to disable for push notifications. |
| `device` *Type: String | Device ID (push token). |
| `pushGateway` *Type: String | `apns` or `gcm`. |
| `callback`Type: Function | Callback invoked on completion. |

### Sample code

```javascript
Pubnub.push.removeChannels(
    {
        channels: ['my_chat'],
        device: 'A655FBA9931AB',
        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 push notifications from all channels registered for the specified push token.

### Method(s)

```javascript
Pubnub.push.deleteDevice({String device, String pushGateway},Function callback)
```

| Parameter | Description |
| --- | --- |
| `device` *Type: String | Device ID (push token). |
| `pushGateway` *Type: String | `apns` or `gcm`. |
| `callback`Type: Function | Callback invoked on completion. |

### Sample code

```javascript
Pubnub.push.deleteDevice(
    {
        device: 'A655FBA9931AB',
        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

* **Channel** - A pathway for sending and receiving messages between devices, created automatically when you first use it, that can handle any number of users and messages for different communication needs, like 1-1 text chats, group conversations, and other data streaming.
* **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.
* **Push token** - A device identifier issued by a push provider (APNs or FCM) used to register a device for receiving mobile push notifications.
