Skip to content

Commit

Permalink
Merge pull request #1120 from alexmercerind/master
Browse files Browse the repository at this point in the history
fix: package not working with Android 13 (SDK 33)
  • Loading branch information
Miguel Ruivo authored Sep 15, 2022
2 parents a5a1108 + f4a8faa commit e46687d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
compileSdkVersion 33

defaultConfig {
minSdkVersion 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,15 @@ public void startFileExplorer(final String type, final boolean isMultipleSelecti
this.isMultipleSelection = isMultipleSelection;
this.loadDataToMemory = withData;
this.allowedExtensions = allowedExtensions;

if (!this.permissionManager.isPermissionGranted(Manifest.permission.READ_EXTERNAL_STORAGE)) {
this.permissionManager.askForPermission(Manifest.permission.READ_EXTERNAL_STORAGE, REQUEST_CODE);
return;
// `READ_EXTERNAL_STORAGE` permission is not needed since SDK 33 (Android 13 or higher).
// `READ_EXTERNAL_STORAGE` & `WRITE_EXTERNAL_STORAGE` are no longer meant to be used, but classified into granular types.
// Reference: https://developer.android.com/about/versions/13/behavior-changes-13
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
if (!this.permissionManager.isPermissionGranted(Manifest.permission.READ_EXTERNAL_STORAGE)) {
this.permissionManager.askForPermission(Manifest.permission.READ_EXTERNAL_STORAGE, REQUEST_CODE);
return;
}
}

this.startFileExplorer();
}

Expand Down

0 comments on commit e46687d

Please sign in to comment.