PushServicesHelper

Helper class for push services.

Helper class for push services.

Syntax: interface PushServicesHelper

Functions

NameDescription
getAvailableCodeGets the availability code of Push Services on the device.
isAvailableChecks if Push Services is available.
raiseAvailabilityErrorRaises an availability error via the registered listeners.
registerListenerRegisters a listener for availability error.
unregisterListenerUnregisters a previously registered listener for availability error.

getAvailableCode

Gets the availability code of Push Services on the device.

Syntax: abstract fun getAvailableCode(context: Context): Int

Return: The availability code indicates the status of Push Services.

Parameters:

ParametersTypeDescription
contextContextThe application context.

isAvailable

Checks if Push Services is available.

Syntax: abstract fun isAvailable(context: Context): Boolean

Return: true if Push Services is available and of the required minimum version.

Parameters:

ParametersTypeDescription
contextBooleanThe application context.

raiseAvailabilityError

Raises an availability error via the registered listeners.

Syntax: abstract fun raiseAvailabilityError(context: Context)

Parameters:

ParametersTypeDescription
contextContextThe application context.

registerListener

Registers a listener for availability error.

Syntax: abstract fun registerListener(listener: OnAvailabilityErrorListener)

Parameters:

ParametersTypeDescription
listenerOnAvailabilityErrorListenerThe OnAvailabilityErrorListener is to be registered.

unregisterListener

Unregisters a previously registered listener for availability error.

Syntax: abstract fun unregisterListener(listener: OnAvailabilityErrorListener)

Parameters:

ParametersTypeDescription
listenerOnAvailabilityErrorListenerThe OnAvailabilityErrorListener is to be registered.