JavaScript REST SDK: PushChannel
The PushChannel object of an HTTP client lists the push subscriptions on a channel. Access it via channel.push.
To subscribe or unsubscribe a device or client ID from a server, use PushAdmin.channelSubscriptions.
1
const pushChannel = channel.push;List subscriptions on this channel
pushChannel.listSubscriptions(params?: Record<string, string>): Promise<PaginatedResult<PushChannelSubscription>>Lists push subscriptions on the channel by querying the REST API's list channel subscriptions endpoint. These subscriptions can be a list of client (clientId) subscriptions, device (deviceId) subscriptions, or a combination of both. This method requires clients to have the Push Admin capability.
1
const subscriptions = await channel.push.listSubscriptions({ deviceId: '<device-id>' });Parameters
The listSubscriptions() method takes the following parameters:
paramsoptionalRecord<String, String>clientId, deviceId, or a combination of both, and a limit on the number of subscriptions returned (up to 1,000).Returns
Promise<PaginatedResult<PushChannelSubscription>>
Returns a promise. The promise is fulfilled with a PaginatedResult containing an array of PushChannelSubscription objects, which supports pagination using its next and first methods, or rejected with an ErrorInfo object.
channelStringdeviceIdString or UndefinedclientId is never present.clientIdString or UndefineddeviceId is never present.