android-components / mozilla.components.lib.push.firebase / AbstractFirebasePushService

AbstractFirebasePushService

abstract class AbstractFirebasePushService : FirebaseMessagingService, PushService (source)

A Firebase Cloud Messaging implementation of the PushService for Android devices that support Google Play Services.

Constructors

Name Summary
<init> AbstractFirebasePushService(coroutineContext: CoroutineContext = Dispatchers.IO)
A Firebase Cloud Messaging implementation of the PushService for Android devices that support Google Play Services.

Functions

Name Summary
deleteToken open fun deleteToken(): Unit
Removes the Firebase instance ID. This would lead a new token being generated when the service hits the Firebase servers.
isServiceAvailable open fun isServiceAvailable(context: <ERROR CLASS>): Boolean
If the push service is support on the device.
onMessageReceived open fun onMessageReceived(remoteMessage: RemoteMessage?): Unit
onNewToken open fun onNewToken(newToken: String): Unit
start open fun start(context: <ERROR CLASS>): Unit
Initializes Firebase and starts the messaging service if not already started and enables auto-start as well.
stop fun stop(): Unit
Stops the Firebase messaging service and disables auto-start.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.