Skip to content

Commit

Permalink
feat: support compileSDK under 33
Browse files Browse the repository at this point in the history
  • Loading branch information
wn-na committed Jan 25, 2024
1 parent 229f555 commit 15db20b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ private boolean requestStoragePermission() {
// android.permission.DETECT_SCREEN_CAPTURE instead.
}

String requestPermission = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
? Manifest.permission.READ_MEDIA_IMAGES
String requestPermission = Build.VERSION.SDK_INT >= 33 // Build.VERSION_CODES.TIRAMISU
? "android.permission.READ_MEDIA_IMAGES" // Manifest.permission.READ_MEDIA_IMAGES
: Manifest.permission.READ_EXTERNAL_STORAGE;

if (ContextCompat.checkSelfPermission(
Expand Down Expand Up @@ -213,6 +213,16 @@ public String getName() {
return NAME;
}

@ReactMethod
public void addListener(String eventName) {
addListener();
}

@ReactMethod
public void removeListeners(Integer count) {
removeListener();
}

@ReactMethod
public void addScreenshotListener() {
addListener();
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 32
targetSdkVersion = 32

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand Down

0 comments on commit 15db20b

Please sign in to comment.