# Enum NearbyPermission

java.lang.Object
java.lang.Enum<NearbyPermission>
com.codename1.nearby.NearbyPermission

All Implemented Interfaces:
  `Comparable<NearbyPermission>`

public enum NearbyPermission extends Enum<NearbyPermission>

The runtime permissions the `com.codename1.nearby` APIs may need, named by what the app is trying to do rather than by any one platform's permission string.

Each entry point takes these as varargs in its `requestPermissions` method and maps them to whatever the running platform actually asks for: on Android a set of manifest permissions, on iOS an authorization prompt raised by the first call that needs it. A port that needs no permission for a given constant reports it granted rather than failing.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ADVERTISE`
  Advertising this device so others can find it.
  `CONNECT`
  Connecting to a discovered device and moving payloads.
  `DISCOVERY`
  Discovering nearby devices to advertise to or range against.
  `RANGING`
  Precision ranging.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static NearbyPermission`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static NearbyPermission[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### RANGING

    public static final NearbyPermission RANGING
    Precision ranging. Android `UWB_RANGING`; on iOS the Nearby Interaction authorization prompted by the first session.

  - ### DISCOVERY

    public static final NearbyPermission DISCOVERY
    Discovering nearby devices to advertise to or range against. Android `BLUETOOTH_SCAN` plus `NEARBY_WIFI_DEVICES` (or location below API 33); on iOS the local network authorization.

  - ### ADVERTISE

    public static final NearbyPermission ADVERTISE
    Advertising this device so others can find it. Android `BLUETOOTH_ADVERTISE`; no iOS equivalent.

  - ### CONNECT

    public static final NearbyPermission CONNECT
    Connecting to a discovered device and moving payloads. Android `BLUETOOTH_CONNECT`; no iOS equivalent.

- ## Method Details

  - ### values

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