@@ -27,7 +27,8 @@ The following steps require to open your `ios` project in Xcode.
27
27
28
28
1 . Enable background mode.
29
29
30
- <img width =" 512 " src =" https://github.com/hnvn/flutter_downloader/blob/master/screenshot/enable_background_mode.png?raw=true " />
30
+ <img width="512"
31
+ src="https://github.com/hnvn/flutter_downloader/blob/master/screenshot/enable_background_mode.png?raw=true"/>
31
32
32
33
2 . Add ` sqlite ` library.
33
34
@@ -110,7 +111,7 @@ private func registerPlugins(registry: FlutterPluginRegistry) {
110
111
- ** Support HTTP request:** if you want to download file with HTTP request, you
111
112
need to disable Apple Transport Security (ATS) feature. There're two options:
112
113
113
- 1 . Disable ATS for a specific domain only: (add following codes to your
114
+ 1 . Disable ATS for a specific domain only: (add the following code to your
114
115
` Info.plist ` file)
115
116
116
117
``` xml
@@ -134,7 +135,7 @@ private func registerPlugins(registry: FlutterPluginRegistry) {
134
135
</dict >
135
136
```
136
137
137
- 2 . Completely disable ATS: (add following codes to your ` Info.plist ` file)
138
+ 2 . Completely disable ATS. Add the following to your ` Info.plist ` file)
138
139
139
140
``` xml
140
141
<key >NSAppTransportSecurity</key >
@@ -146,7 +147,7 @@ private func registerPlugins(registry: FlutterPluginRegistry) {
146
147
- ** Configure maximum number of concurrent tasks:** the plugin allows 3 download
147
148
tasks running at a moment by default (if you enqueue more than 3 tasks,
148
149
there're only 3 tasks running, other tasks are put in pending state). You can
149
- change this number by adding following codes to your ` Info.plist ` file.
150
+ change this number by adding the following code to your ` Info.plist ` file.
150
151
151
152
``` xml
152
153
<!-- changes this number to configure the maximum number of concurrent tasks -->
@@ -172,12 +173,14 @@ private func registerPlugins(registry: FlutterPluginRegistry) {
172
173
173
174
## Android integration
174
175
175
- There's no additional configurations required on Android.
176
+ You don't have to do anything extra to make the plugin work on Android.
176
177
177
- In order to handle click action on notification to open the downloaded file on
178
- Android, you need to add some additional configurations.
178
+ There are although a few optional settings you might want to configure.
179
179
180
- Add the following to ` AndroidManifest.xml ` :
180
+ ### Open downloaded file from notification
181
+
182
+ To make tapping on notification open the downloaded file on Android, add the
183
+ following code to ` AndroidManifest.xml ` :
181
184
182
185
``` xml
183
186
<provider
@@ -191,20 +194,19 @@ Add the following to `AndroidManifest.xml`:
191
194
</provider >
192
195
```
193
196
194
- ** Note: **
197
+ ** Notes **
195
198
196
199
- You have to save your downloaded files in external storage (where the other
197
200
applications have permission to read your files)
198
- - The downloaded files are only able to be opened if your device has at least an
199
- application that can read these file types (mp3, pdf, etc)
201
+ - The downloaded files are only able to be opened if your device has at least
202
+ one application that can read these file types (mp3, pdf, etc. )
200
203
201
- ### Optional configuration:
204
+ ### Configure maximum number of concurrent download tasks
202
205
203
- - ** Configure maximum number of concurrent tasks:** the plugin depends on
204
- ` WorkManager ` library and ` WorkManager ` depends on the number of available
205
- processor to configure the maximum number of tasks running at a moment. You
206
- can setup a fixed number for this configuration by adding following codes to
207
- your ` AndroidManifest.xml ` :
206
+ The plugin depends on ` WorkManager ` library and ` WorkManager ` depends on the
207
+ number of available processor to configure the maximum number of tasks running
208
+ at a moment. You can setup a fixed number for this configuration by adding the
209
+ following code to your ` AndroidManifest.xml ` :
208
210
209
211
``` xml
210
212
<!-- Begin FlutterDownloader customization -->
@@ -233,9 +235,10 @@ Add the following to `AndroidManifest.xml`:
233
235
<!-- End FlutterDownloader customization -->
234
236
```
235
237
236
- - ** Localize notification messages:** you can localize notification messages of
237
- download progress by localizing following messages. (you can find the detail
238
- of string localization in Android in this [ link] [ 4 ] )
238
+ ### Localize strings in notifications
239
+
240
+ You can localize texts in download progress notifications by localizing
241
+ following messages.
239
242
240
243
``` xml
241
244
<string name =" flutter_downloader_notification_started" >Download started</string >
@@ -246,9 +249,13 @@ Add the following to `AndroidManifest.xml`:
246
249
<string name =" flutter_downloader_notification_paused" >Download paused</string >
247
250
```
248
251
249
- - ** PackageInstaller:** in order to open APK files, your application needs
250
- ` REQUEST_INSTALL_PACKAGES ` permission. Add the following code in your
251
- ` AndroidManifest.xml ` :
252
+ You can learn more about localization on Android [ here] [ 4 ] ).
253
+
254
+ ### Install .apk files
255
+
256
+ To open and install ` .apk ` files, your application needs
257
+ ` REQUEST_INSTALL_PACKAGES ` permission. Add the following in your
258
+ ` AndroidManifest.xml ` :
252
259
253
260
``` xml
254
261
<uses-permission android : name =" android.permission.REQUEST_INSTALL_PACKAGES" />
@@ -437,12 +444,16 @@ plugin is missing some feature.
437
444
438
445
Pull request are also very welcome!
439
446
440
- [ fluttercommunity_badge ] : https://fluttercommunity.dev/_github/header/flutter_downloader
447
+ [ fluttercommunity_badge] :
448
+ https://fluttercommunity.dev/_github/header/flutter_downloader
441
449
[ fluttercommunity_link ] : https://github.com/fluttercommunity/community
442
450
[ pub_badge ] : https://img.shields.io/pub/v/flutter_downloader.svg
443
451
[ pub_link ] : https://pub.dartlang.org/packages/flutter_downloader
444
- [ work_manager ] : https://developer.android.com/topic/libraries/architecture/workmanager
445
- [ url_session_download_task ] : https://developer.apple.com/documentation/foundation/nsurlsessiondownloadtask?language=objc
446
- [ android_9_cleartext_traffic ] : https://medium.com/@son.rommer/fix-cleartext-traffic-error-in-android-9-pie-2f4e9e2235e6
452
+ [ work_manager] :
453
+ https://developer.android.com/topic/libraries/architecture/workmanager
454
+ [ url_session_download_task] :
455
+ https://developer.apple.com/documentation/foundation/nsurlsessiondownloadtask?language=objc
456
+ [ android_9_cleartext_traffic] :
457
+ https://medium.com/@son.rommer/fix-cleartext-traffic-error-in-android-9-pie-2f4e9e2235e6
447
458
[ 3 ] : https://medium.com/@guerrix/info-plist-localization-ad5daaea732a
448
459
[ 4 ] : https://developer.android.com/training/basics/supporting-devices/languages
0 commit comments