Skip to content

Commit

Permalink
chore(storage, android)!: remove EXTERNAL_STORAGE permissions for And…
Browse files Browse the repository at this point in the history
…roid 10/11 compat

On Android the following paths exist in app.utils.paths but are inaccessible without special permission:
  'EXTERNAL_DIRECTORY',
  'EXTERNAL_STORAGE_DIRECTORY',
  'PICTURES_DIRECTORY',
  'MOVIES_DIRECTORY',

Please follow Google's migration guides for "Scoped Storage" to store your data in a future compatible way.
https://developer.android.com/about/versions/11/privacy/storage#scoped-storage

BREAKING CHANGE: if you need READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE permission add them in your app AndroidManifest.xml
  • Loading branch information
mikehardy committed May 19, 2021
1 parent cf7b157 commit 69b6f88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/app/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export namespace Utils {
* Traditionally this is an SD card, but it may also be implemented as built-in storage on a device.
*
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
* Requires special permission granted by Play Store review team on Android, is unlikely to be a valid path.
*
* ```js
* firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY;
Expand All @@ -349,6 +350,7 @@ export namespace Utils {

/**
* Returns an absolute path to a directory in which to place pictures that are available to the user.
* Requires special permission granted by Play Store review team on Android, is unlikely to be a valid path.
*
* ```js
* firebase.utils.FilePath.PICTURES_DIRECTORY;
Expand All @@ -358,6 +360,7 @@ export namespace Utils {

/**
* Returns an absolute path to a directory in which to place movies that are available to the user.
* Requires special permission granted by Play Store review team on Android, is unlikely to be a valid path.
*
* ```js
* firebase.utils.FilePath.MOVIES_DIRECTORY;
Expand Down
3 changes: 0 additions & 3 deletions packages/storage/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- TODO(salakar) Not sure if this should be part of the package manifest or leave to users app manifest code? -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

0 comments on commit 69b6f88

Please sign in to comment.