android-components / mozilla.components.feature.push / PushConnection

PushConnection

interface PushConnection : Closeable (source)

An interface that wraps the PushAPI.

This aides in testing and abstracting out the hurdles of initialization checks required before performing actions on the API.

Functions

Name Summary
decrypt abstract fun decrypt(channelId: String, body: String, encoding: String = "", salt: String = "", cryptoKey: String = ""): ByteArray
isInitialized abstract fun isInitialized(): Boolean
subscribe abstract suspend fun subscribe(channelId: String, scope: String = ""): SubscriptionResponse
unsubscribe abstract suspend fun unsubscribe(channelId: String): Boolean
unsubscribeAll abstract suspend fun unsubscribeAll(): Boolean
updateToken abstract suspend fun updateToken(token: String): Boolean
verifyConnection abstract suspend fun verifyConnection(): Boolean

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.