Interface IPushDeviceState

All Known Implementing Classes:
PushDeviceStateImpl

public interface IPushDeviceState
What one device can do for Push Notification right now, as the client reports it.

Decided on the device by feature detection, never by browser or version sniffing (ruling R2): a Browser supports Push Notification when it has the Notification API, a Service Worker registration and the Push API, all three; a Cordova app when the FirebaseX plugin is present.

Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the device UUID, the X-iizi header of the PN HTTP API.
    Gets the notification permission.
    Gets the transport this device would be reached through.
    boolean
    Checks whether the device holds a subscription for this application that this server also holds.
  • Method Details

    • getDeviceUUID

      String getDeviceUUID()
      Gets the device UUID, the X-iizi header of the PN HTTP API.
      Returns:
      The canonical 36-character UUID, never null.
    • getPermission

      PushPermission getPermission()
      Gets the notification permission.
      Returns:
      The permission, never null; PushPermission.UNSUPPORTED when the device cannot receive Push Notification at all.
    • getTransport

      PushTransport getTransport()
      Gets the transport this device would be reached through.
      Returns:
      PushTransport.VAPID for a Browser, PushTransport.FCM for a Cordova app, or null when the device is PushPermission.UNSUPPORTED.
    • isSubscribed

      boolean isSubscribed()
      Checks whether the device holds a subscription for this application that this server also holds. A device subscription the server does not know, or a stored row whose device has lost its subscription, is not subscribed.
      Returns:
      true when both ends hold the subscription.