PushServicesHelper
Helper class for push services.
Helper class for push services.
Syntax: interface PushServicesHelper
Functions
Name | Description |
---|---|
getAvailableCode | Gets the availability code of Push Services on the device. |
isAvailable | Checks if Push Services is available. |
raiseAvailabilityError | Raises an availability error via the registered listeners. |
registerListener | Registers a listener for availability error. |
unregisterListener | Unregisters 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:
Parameters | Type | Description |
---|---|---|
context | Context | The 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:
Parameters | Type | Description |
---|---|---|
context | Boolean | The application context. |
raiseAvailabilityError
Raises an availability error via the registered listeners.
Syntax: abstract fun raiseAvailabilityError(context: Context)
Parameters:
Parameters | Type | Description |
---|---|---|
context | Context | The application context. |
registerListener
Registers a listener for availability error.
Syntax: abstract fun registerListener(listener: OnAvailabilityErrorListener)
Parameters:
Parameters | Type | Description |
---|---|---|
listener | OnAvailabilityErrorListener | The OnAvailabilityErrorListener is to be registered. |
unregisterListener
Unregisters a previously registered listener for availability error.
Syntax: abstract fun unregisterListener(listener: OnAvailabilityErrorListener)
Parameters:
Parameters | Type | Description |
---|---|---|
listener | OnAvailabilityErrorListener | The OnAvailabilityErrorListener is to be registered. |
Updated 8 days ago