java.lang.Object | |
↳ | com.urbanairship.push.notifications.NotificationChannelCompat |
Compatibility class for supporting NotificationChannel functionality across Android OS versions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NotificationChannelCompat(NotificationChannel notificationChannel)
NotificationChannelCompat constructor.
| |||||||||||
NotificationChannelCompat(String id, CharSequence name, int importance)
NotificationChannelCompat constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
enableLights(boolean lights)
Sets whether the channel can show lights.
| ||||||||||
void |
enableVibration(boolean vibration)
Sets whether the channel can vibrate.
| ||||||||||
boolean | equals(Object o) | ||||||||||
static NotificationChannelCompat |
fromJson(JsonValue jsonValue)
Factory method for creating a NotificationChannelCompat out of a JSON payload.
| ||||||||||
boolean |
getBypassDnd()
Indicates whether the channel can bypass do-not-disturb.
| ||||||||||
String |
getDescription()
Gets the channel's description.
| ||||||||||
String |
getGroup()
Gets the channel's group.
| ||||||||||
String |
getId()
Gets the channel's identifier.
| ||||||||||
int |
getImportance()
Gets the channel's importance.
| ||||||||||
int |
getLightColor()
Gets the channel's light color.
| ||||||||||
int |
getLockscreenVisibility()
Gets the channel's lockscreen visibility.
| ||||||||||
CharSequence |
getName()
Gets the channel's name.
| ||||||||||
boolean |
getShowBadge()
Indicates whether the channel can show badges
| ||||||||||
Uri |
getSound()
Gets the channel's sound.
| ||||||||||
long[] |
getVibrationPattern()
Gets the channel's vibration pattern.
| ||||||||||
int | hashCode() | ||||||||||
void |
setBypassDnd(boolean bypassDnd)
Sets whether the channel can bypass do-not-disturb.
| ||||||||||
void |
setDescription(String description)
Sets the channel's description.
| ||||||||||
void |
setGroup(String group)
Sets the channel's group.
| ||||||||||
void |
setImportance(int importance)
Sets the channel's importance.
| ||||||||||
void |
setLightColor(int argb)
Sets the channel's light color.
| ||||||||||
void |
setLockscreenVisibility(int lockscreenVisibility)
Sets the channel's lockscreen visibility.
| ||||||||||
void |
setName(CharSequence name)
Sets the channel's name.
| ||||||||||
void |
setShowBadge(boolean showBadge)
Sets whether the channel can show badges.
| ||||||||||
void |
setSound(Uri sound)
Sets the channel's sound.
| ||||||||||
void |
setVibrationPattern(long[] vibrationPattern)
Sets the channel's vibration pattern.
| ||||||||||
boolean |
shouldShowLights()
Indicates whether the channel can show lights.
| ||||||||||
boolean |
shouldVibrate()
Indicates whether the channel can vibrate.
| ||||||||||
JsonValue |
toJsonValue()
Returns the objects represented as a JsonValue.
| ||||||||||
NotificationChannel |
toNotificationChannel()
Creates a corresponding NotificationChannel object for Android O and above.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
NotificationChannelCompat constructor.
notificationChannel | A NotificationChannel instance. |
---|
NotificationChannelCompat constructor.
id | The channel identifier. |
---|---|
name | The channel name. |
importance | The notification importance. |
Sets whether the channel can show lights.
lights | Whether the channel can show lights. |
---|
Sets whether the channel can vibrate.
vibration | Whether the channel can vibrate. |
---|
Factory method for creating a NotificationChannelCompat out of a JSON payload.
jsonValue | The JSON payload. |
---|
null
if one could not be deserialized.
Indicates whether the channel can bypass do-not-disturb.
true
if the channel can bypass do-not-disturb, false
otherwise.
Gets the channel's importance.
Gets the channel's light color.
Gets the channel's lockscreen visibility.
Indicates whether the channel can show badges
true
if the channel can show badges, false
otherwise.
Gets the channel's vibration pattern.
Sets whether the channel can bypass do-not-disturb.
bypassDnd | Whether the channel can bypass do-not-disturb. |
---|
Sets the channel's description.
description | The description. |
---|
Sets the channel's importance.
importance | The importance. |
---|
Sets the channel's light color.
argb | The light color. |
---|
Sets the channel's lockscreen visibility.
lockscreenVisibility | The lockscreen visibility. |
---|
Sets whether the channel can show badges.
showBadge | Whether the channel can show badges. |
---|
Sets the channel's vibration pattern.
vibrationPattern | The vibration pattern. |
---|
Indicates whether the channel can show lights.
true
if the channel can show lights, false
otherwise.
Indicates whether the channel can vibrate.
true
if the channel can vibrate, false
otherwise.
Returns the objects represented as a JsonValue.
Creates a corresponding NotificationChannel object for Android O and above.