Enum PushType

java.lang.Object
java.lang.Enum<PushType>
com.eatthepath.pushy.apns.PushType
All Implemented Interfaces:
Serializable, Comparable<PushType>, java.lang.constant.Constable

public enum PushType extends Enum<PushType>
An enumeration of push notification display types. Note that push notification display types are required in iOS 13 and later and watchOS 6 and later, but are ignored under earlier versions of either operating system.
Since:
0.13.9
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Indicates that a push notification is expected to display an alert, play a sound, or badges the receiving apps' icon.
    Indicates that a push notification is not expected to interact with the user on the receiving device.
    Indicates that a push notification is intended to provide an update for a watchOS app complication.
    Indicates that a push notification is intended to update a File Provider extension.
    Indicates that a push notification is intended to update a running Live Activity.
    Indicates that a push notification is intended to query the destination device's location and activate a Location Push Service Extension on the destination device.
    Indicates that a push notification is intended to cause the receiving device to contact its mobile device management (MDM) server.
    Indicates that a push notification is intended to notify the destination device that new push-to-talk audio is available.
    Indicates that a push notification is expected to activate the client for handling VoIP flow.
  • Method Summary

    Modifier and Type
    Method
    Description
    static PushType
     
     
    static PushType
    Returns the enum constant of this type with the specified name.
    static PushType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ALERT

      public static final PushType ALERT

      Indicates that a push notification is expected to display an alert, play a sound, or badges the receiving apps' icon. According to Apple's documentation:

      Use the alert push type for notifications that trigger a user interaction—for example, an alert, badge, or sound. If you set this push type, the apns-topic header field must use your app’s bundle ID as the topic… The alert push type is required on watchOS 6 and later. It is recommended on macOS, iOS, tvOS, and iPadOS.
      Since:
      0.13.9
    • BACKGROUND

      public static final PushType BACKGROUND

      Indicates that a push notification is not expected to interact with the user on the receiving device. According to Apple's documentation:

      Use the background push type for notifications that deliver content in the background, and don’t trigger any user interactions. If you set this push type, the apns-topic header field must use your app’s bundle ID as the topic. The background push type is required on watchOS 6 and later. It is recommended on macOS, iOS, tvOS, and iPadOS.
      Since:
      0.13.9
    • VOIP

      public static final PushType VOIP

      Indicates that a push notification is expected to activate the client for handling VoIP flow. According to Apple's documentation:

      Use the voip push type for notifications that provide information about an incoming Voice-over-IP (VoIP) call… If you set this push type, the apns-topic header field must use your app’s bundle ID with .voip appended to the end. If you’re using certificate-based authentication, you must also register the certificate for VoIP services. The topic is then part of the 1.2.840.113635.100.6.3.4 or 1.2.840.113635.100.6.3.6 extension. The voip push type is not available on watchOS. It is recommended on macOS, iOS, tvOS, and iPadOS.
      Since:
      0.13.10
    • COMPLICATION

      public static final PushType COMPLICATION

      Indicates that a push notification is intended to provide an update for a watchOS app complication. According to Apple's documentation:

      Use the complication push type for notifications that contain update information for a watchOS app’s complications… If you set this push type, the apns-topic header field must use your app’s bundle ID with .complication appended to the end. If you’re using certificate-based authentication, you must also register the certificate for WatchKit services. The topic is then part of the 1.2.840.113635.100.6.3.6 extension. The complication push type is recommended for watchOS and iOS. It is not available on macOS, tvOS, and iPadOS.
      Since:
      0.13.10
    • FILEPROVIDER

      public static final PushType FILEPROVIDER

      Indicates that a push notification is intended to update a File Provider extension. According to Apple's documentation:

      Use the fileprovider push type to signal changes to a File Provider extension. If you set this push type, the apns-topic header field must use your app’s bundle ID with .pushkit.fileprovider appended to the end… The fileprovider push type is not available on watchOS. It is recommended on macOS, iOS, tvOS, and iPadOS.
      Since:
      0.13.10
    • MDM

      public static final PushType MDM

      Indicates that a push notification is intended to cause the receiving device to contact its mobile device management (MDM) server. According to Apple's documentation:

      Use the mdm push type for notifications that tell managed devices to contact the MDM server. If you set this push type, you must use the topic from the UID attribute in the subject of your MDM push certificate… The mdm push type is not available on watchOS. It is recommended on macOS, iOS, tvOS, and iPadOS.
      Since:
      0.13.10
    • LOCATION

      public static final PushType LOCATION

      Indicates that a push notification is intended to query the destination device's location and activate a Location Push Service Extension on the destination device. According to Apple's documentation:

      Use the location push type for notifications that request a user’s location. If you set this push type, the apns-topic header field must use your app’s bundle ID with .location-query appended to the end.

      The location push type is recommended for iOS and iPadOS. It isn’t available on macOS, tvOS, and watchOS.

      If the location query requires an immediate response from the Location Push Service Extension, set notification apns-priority to 10 [DeliveryPriority.IMMEDIATE]; otherwise, use 5 [DeliveryPriority.CONSERVE_POWER].

      The location push type supports only token-based authentication.

      Since:
      0.15.1
      See Also:
    • LIVE_ACTIVITY

      public static final PushType LIVE_ACTIVITY
      Indicates that a push notification is intended to update a running Live Activity. Note that Live Activity updates must be sent to a specific topic ([base bundle ID].push-type.liveactivity) and include specific payload keys (see ApnsPayloadBuilder.setContentState(Map), ApnsPayloadBuilder.setEvent(LiveActivityEvent), ApnsPayloadBuilder.setDismissalDate(Instant), and ApnsPayloadBuilder.setTimestamp(Instant)).
      Since:
      0.15.2
      See Also:
    • PUSH_TO_TALK

      public static final PushType PUSH_TO_TALK

      Indicates that a push notification is intended to notify the destination device that new push-to-talk audio is available. Note that push-to-talk notifications must be sent to a specific topic ([base bundle ID].voip-ptt) and a device token that, according to Apple's documentation:

      …an app receives when joining a channel. A token is only active for the life of a channel, so an app receives a new token every time it joins a new channel.

      Additionally, Apple recommends sending push-to-talk notifications with an immediate delivery priority (see ApnsPushNotification.getPriority() and an immediate expiration (see ApnsPushNotification.getExpiration().

      Since:
      0.15.2
      See Also:
  • Method Details

    • values

      public static PushType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PushType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getHeaderValue

      public String getHeaderValue()
    • getFromHeaderValue

      public static PushType getFromHeaderValue(CharSequence headerValue)