android-components / mozilla.components.concept.push / PushProcessor


interface PushProcessor (source)

A push notification processor that handles registration and new messages from the PushService provided. Starting Push in the Application’s onCreate is recommended.


Name Summary
initialize abstract fun initialize(): Unit
Start the push processor and any service associated.
onError abstract fun onError(error: PushError): Unit
An error has occurred.
onMessageReceived abstract fun onMessageReceived(message: EncryptedPushMessage): Unit
A new push message has been received.
onNewToken abstract fun onNewToken(newToken: String): Unit
A new registration token has been received.
renewRegistration abstract fun renewRegistration(): Unit
Requests the PushService to renew it’s registration with it’s provider.
shutdown abstract fun shutdown(): Unit
Removes all push subscriptions from the device.

Companion Object Properties

Name Summary
requireInstance val requireInstance: PushProcessor

Companion Object Functions

Name Summary
install fun install(processor: PushProcessor): Unit
Initialize and installs the PushProcessor into the application. This needs to be called in the application’s onCreate before a push service has started.

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.


Name Summary
AutoPushFeature class AutoPushFeature : PushProcessor, Observable<Observer>
A implementation of a PushProcessor that should live as a singleton by being installed in the Application’s onCreate. It receives messages from a service and forwards them to be decrypted and routed.