public interface WebPushDelegate
Modifier and Type | Method and Description |
---|---|
default GeckoResult<WebPushSubscription> |
onGetSubscription(String scope)
Retrieves a subscription for the given service worker scope.
|
default GeckoResult<WebPushSubscription> |
onSubscribe(String scope,
byte[] appServerKey)
Creates a push subscription for the given service worker scope.
|
default GeckoResult<Void> |
onUnsubscribe(String scope)
Removes a push subscription.
|
@UiThread @Nullable default GeckoResult<WebPushSubscription> onSubscribe(@NonNull String scope, @Nullable byte[] appServerKey)
WebPushSubscription
in order
to support onGetSubscription(String)
.scope
- The Service Worker scope.appServerKey
- An optional application server key.GeckoResult
which resolves to a WebPushSubscription
@UiThread @Nullable default GeckoResult<WebPushSubscription> onGetSubscription(@NonNull String scope)
scope
- The scope for the requested WebPushSubscription
.GeckoResult
which resolves to a WebPushSubscription
@UiThread @Nullable default GeckoResult<Void> onUnsubscribe(@NonNull String scope)
GeckoResult
with an exception.scope
- The Service Worker scope for the subscription.GeckoResult
, which if non-exceptional indicates successfully unsubscribing.