Required permissions

  • Your app must declare permissions for each Awareness API method used, with specific permissions varying based on the method and fence type.

  • Refer to the provided documentation to identify the necessary permissions for each Awareness API method.

  • The Snapshot API requires specific permissions for accessing detected activities, beacon state, and location, while headphone state requires no permission.

  • The Fence API requires specific permissions for activity, beacon, and location fences, while headphone and time fences require no permission.

Your app must declare permissions for each API method that's used. The required permissions vary. It depends on the API methods and fence types used by your app. Reference this documentation to learn which permissions are required for each method.

Snapshot API

The following table shows the permissions required for each Snapshot API method:

Method Required Android permission
getDetectedActivity()

android.permission.ACTIVITY_RECOGNITION

com.google.android.gms.permission.ACTIVITY_RECOGNITION (Android 9 (API level 28))

getBeaconState() android.permission.ACCESS_FINE_LOCATION
getHeadphoneState() none
getLocation() android.permission.ACCESS_FINE_LOCATION

Fence API

The following table shows the permissions required for each Fence API fence type:

Fence API fence type Required Android permission
DetectedActivityFence

android.permission.ACTIVITY_RECOGNITION

com.google.android.gms.permission.ACTIVITY_RECOGNITION (Android 9 (API level 28))

BeaconFence android.permission.ACCESS_FINE_LOCATION
HeadphoneFence none
LocationFence android.permission.ACCESS_FINE_LOCATION
TimeFence none