hasScreenshotPermission

Check if the app has the required permission for screenshot detection.

On Android 14+, this always returns true because no runtime permission is required (screenshot detection uses the ScreenCaptureCallback API).

On Android 13+, checks if READ_MEDIA_IMAGES permission is granted.

On Android 12 and below, checks if READ_EXTERNAL_STORAGE permission is granted.

Return

true if the permission is granted or not required, false otherwise

Example:

if (!BugScreenSDK.hasScreenshotPermission(this)) {
// Permission not granted, request it
BugScreenSDK.requestScreenshotPermission(this) { granted ->
if (granted) {
// Permission granted
}
}
}

Parameters

context

Android context