Enum HealthRequestStatus

java.lang.Object
java.lang.Enum<HealthRequestStatus>
com.codename1.health.HealthRequestStatus
All Implemented Interfaces:
Comparable<HealthRequestStatus>

public enum HealthRequestStatus extends Enum<HealthRequestStatus>

Whether presenting the authorization sheet would actually show the user anything. Maps HKHealthStore.getRequestStatusForAuthorization on iOS and a permission-set comparison on Android.

This is the only read-related signal iOS offers, and it is one-way: UNNECESSARY means "the user has already been asked", never "the user said yes". Use it to decide whether to show a pre-permission explainer screen, not to decide whether reads will return data.

  • Enum Constant Details

    • SHOULD_REQUEST

      public static final HealthRequestStatus SHOULD_REQUEST
      At least one requested access has never been presented; showing the sheet will prompt the user.
    • UNNECESSARY

      public static final HealthRequestStatus UNNECESSARY
      Every requested access has already been presented. The user may have granted or denied any of them; this value does not say which, and showing the sheet again would display nothing.
    • UNKNOWN

      public static final HealthRequestStatus UNKNOWN
      The platform could not determine the status.
  • Method Details

    • values

      public static HealthRequestStatus[] 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 HealthRequestStatus 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