android-components / mozilla.components.concept.engine.webpush / WebPushDelegate

WebPushDelegate

interface WebPushDelegate (source)

Notifies applications or other components of engine events related to Web Push notifications.

Functions

Name Summary
onGetSubscription open fun onGetSubscription(scope: String, onSubscription: (WebPushSubscription?) -> Unit): Unit
Requests a WebPush subscription for the given Service Worker scope.
onSubscribe open fun onSubscribe(scope: String, serverKey: ByteArray?, onSubscribe: (WebPushSubscription?) -> Unit): Unit
Create a WebPush subscription for the given Service Worker scope.
onUnsubscribe open fun onUnsubscribe(scope: String, onUnsubscribe: (Boolean) -> Unit): Unit
Remove a subscription for the given Service Worker scope.

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.