Channel

UaSDK. Channel

Your user's channel

Constructor

new Channel()

Properties:
Name Type Description
channel.id string

This channel's ID

channel.optedIn boolean

Is this channel opted in to push notifications?

channel.tags UaSDK.Channel.Tags

This channel's tags

channel.namedUser UaSDK.Channel.NamedUser

This channel's named user

channel.attributes UaSDK.Channel.Attributes

This channel's attributes

Example
// You will access this through the sdk
UA.then(function(sdk) {
 // sdk.getChannel() will resolve as soon as a channel is loaded (existing user), or upon registration (new user)
 sdk.getChannel().then(channel => {
   console.log("Channel ID: %s", channel.id)
 })
})

Classes

NamedUser

Members

subscriptions :SubscriptionListManager

The subscription manager for this channel.

Type:

Methods

(async) optOut() → {Promise.<boolean>}

Opt this channel out of push notifications. In order to opt back in you need to call UaSDK#register again.

Returns:
Type:
Promise.<boolean>

Resolves to true if successful

Example
UA.then(function(sdk) {
 sdk.channel.optOut().then(() => console.log("User is now opt-out"))
})