NotificationHelper
The NotificationHelper model is a simple firebase wrapper that initializes the application when it is awoken from the killed state. It gets the firebase channel ID and creates notification channels.
Available in the package com.voxeet.sdk.push.utils.NotificationHelper.
Methods
getChannelId
▸ getChannelId(@NonNull context
: Context): String
Gets the Firebase channel ID.
Parameters
Name | Type | Description |
---|---|---|
context | Context | non null application context |
Returns: String - The channel ID for Voxeet notifications.
createNotificationChannel
▸ createNotificationChannel(@NonNull context
: Context): boolean
Helps to create the Voxeet default channel. It is used because Firebase and Android require applications to have their own valid notification channels.
Parameters
Name | Type | Description |
---|---|---|
context | Context | non null that will be manipulated to create the channel |
Returns: boolean - a flag indicating if the channel is set properly. A false value informs that this method was already called for the Android version where it's mandatory. Android versions prior to Android O always return a true value.
createNotificationChannel
▸ createNotificationChannel(@NonNull context
: Context, @NonNull id
: String, @NonNull name
: CharSequence, @NonNull description
: String, argb
: int): boolean
Creates the notification channel because Firebase and Android require applications to have their own valid notification channels.
Parameters
Name | Type | Description |
---|---|---|
context | Context | non null that will be manipulated to create the channel |
id | String | non null channel ID |
name | CharSequence | non null displayed name of the channel (to be translated) |
description | String | non null description of the channel (to be translated) |
argb | int | color of the notifications in the 0xaarrggbb representation |
Returns: boolean - a flag indicating if the channel is set up properly. A false value informs that this method was already called for the Android version where it is mandatory. Android versions prior to Android O always return a true value.
Updated about 2 years ago