You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/nativescript-filepicker/README.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,9 +69,9 @@ try {
69
69
70
70
### Android Permissions
71
71
72
-
To request permissions in the demo app, we use the @nativescript-community [perms plugin](https://github.com/nativescript-community/perms). While this is not required for all OS versions and their system pickers, just to be safe you should request it so user is aware.
72
+
To request permissions in the demo app, we use the @nativescript-community [perms plugin](https://github.com/nativescript-community/perms). What's actually required to be granted by the user depends on the target API version and the device API version.
73
73
74
-
Be sure to have permissions add the following lines in AndroidManifest.xml if targeting API 26+.
74
+
If targeting API 25-33, be sure to have the legacy storage permission declared in your app by adding the following lines in AndroidManifest.xml.
75
75
76
76
```xml
77
77
<manifest ...>
@@ -83,23 +83,30 @@ Be sure to have permissions add the following lines in AndroidManifest.xml if ta
83
83
</manifest>
84
84
```
85
85
86
-
For API 33+, you'll also need to add the following to the Android Manifest as well as request additional permissions:
86
+
*NOTE*: When targeting API 34+, the legacy permission has been deprecated on devices running API 26-32, but still requires the user to grant for API <26 devices.
87
+
88
+
To request the legacy permission, use the following before opening the picker:
89
+
```javascript
90
+
request('storage');
91
+
```
92
+
93
+
To support API 33+ devices, you'll also need to add the following to the Android Manifest and request the new permissions:
Before launching the picker on API 33+, you'll need to request the following permissions to allow picker access to all file types:
101
+
Before launching the picker on API 33+ devices, you'll need to request the following permissions to allow picker access to all file types:
95
102
96
103
```javascript
97
104
request('photo');
98
105
request('video');
99
106
request('audio');
100
107
```
101
108
102
-
For an example, look at the `pickAll` function inside the `filepicker.ts` file in the dmeo app.
109
+
For a working permissions example, look at the `pickAll` function inside the `filepicker.ts` file in the demo app.
103
110
104
111
### iOS Permissions
105
112
@@ -131,13 +138,13 @@ Each platform natively supports a different set of file/mime types, you can see
131
138
132
139
The Android stock file picker also supports selecting files from Google Photos and Google Drive if you have an account signed in on the Android device. Other document provider apps installed on your device may also offer additional services.
133
140
134
-
Tested and working on Android API 25-33.
141
+
Tested and working on Android API 25-34.
135
142
136
143
## iOS
137
144
138
145
The iOS pickers also support selecting files from an associated iCloud account if the user has signed in on the device. Note that for a production application, you'll need to add the iCloud capability to your iOS application, and register that entitlement via the Apple Developer site for that package id. After that, update the relevant keys as shown in the demo application's `Info.plist`.
0 commit comments