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

NameTypeDescription
contextContextnon 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

NameTypeDescription
contextContextnon 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

NameTypeDescription
contextContextnon null that will be manipulated to create the channel
idStringnon null channel ID
nameCharSequencenon null displayed name of the channel (to be translated)
descriptionStringnon null description of the channel (to be translated)
argbintcolor 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.