flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

File not opening on clicking on Notification bar

Open utsav-savani opened this issue 3 years ago • 20 comments

The file after successfully being download when I tap on notification then it does open the downloaded file. Please help Image of my code: image

Image of my android manifest file: image

utsav-savani avatar Jul 01 '21 11:07 utsav-savani

I believe flutter downloader does not work with android 11

cbanaspk avatar Jul 08 '21 20:07 cbanaspk

Thank you @cbanaspk. So I guess I cannot launch the app till this issue gets fixed.

utsav-savani avatar Jul 09 '21 02:07 utsav-savani

Thank you @cbanaspk. So I guess I cannot launch the app till this issue gets fixed.

Does not seem like it. Hopefully Dio works because flutter_downloader not working for the current version of Android is a big flaw.

cbanaspk avatar Jul 09 '21 13:07 cbanaspk

But dio does not give notification in notification bar.

On Fri, Jul 9, 2021, 7:10 PM cbanaspk @.***> wrote:

Thank you @cbanaspk https://github.com/cbanaspk. So I guess I cannot launch the app till this issue gets fixed.

Does not seem like it. Hopefully Dio works because flutter_downloader not working for the current version of Android is a big flaw.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fluttercommunity/flutter_downloader/issues/486#issuecomment-877197920, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVJ6YNYRIQ2LU2H63T4HXLTW336DANCNFSM47UJGVJQ .

utsav-savani avatar Jul 09 '21 13:07 utsav-savani

But dio does not give notification in notification bar. On Fri, Jul 9, 2021, 7:10 PM cbanaspk @.***> wrote: Thank you @cbanaspk https://github.com/cbanaspk. So I guess I cannot launch the app till this issue gets fixed. Does not seem like it. Hopefully Dio works because flutter_downloader not working for the current version of Android is a big flaw. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#486 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVJ6YNYRIQ2LU2H63T4HXLTW336DANCNFSM47UJGVJQ .

Yeah, I'm having issues with Dio anyways with an "error 21" in regards to trying to use path provider to get the external storage directory.

cbanaspk avatar Jul 09 '21 17:07 cbanaspk

For Flutter_Downloader

If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

arshadbarves avatar Jul 10 '21 15:07 arshadbarves

I believe flutter downloader does not work with android 11

For Flutter_Downloader

If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

arshadbarves avatar Jul 10 '21 15:07 arshadbarves

I believe flutter downloader does not work with android 11

For Flutter_Downloader

If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

I did the line is already added but still, issue in Android 11

utsav-savani avatar Jul 13 '21 13:07 utsav-savani

I believe flutter downloader does not work with android 11

For Flutter_Downloader If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

I did the line is already added but still, issue in Android 11

https://www.youtube.com/watch?v=3gNd1Ma-gss&list=FLcgfafWRwPYXKs6NliCs5Xw&index=1&t=85s. Along with that video, this tutorial https://medium.com/@michallot/how-to-write-a-simple-downloading-app-with-flutter-2f55ae516867 helped with displaying notifications for downloading with dio. I did have to tweak the build.grade file and set SDK to 29 along with bumping down some of the plugin versions.

cbanaspk avatar Jul 13 '21 17:07 cbanaspk

I believe flutter downloader does not work with android 11

For Flutter_Downloader If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

I did the line is already added but still, issue in Android 11

https://www.youtube.com/watch?v=3gNd1Ma-gss&list=FLcgfafWRwPYXKs6NliCs5Xw&index=1&t=85s. Along with that video, this tutorial https://medium.com/@michallot/how-to-write-a-simple-downloading-app-with-flutter-2f55ae516867 helped with displaying notifications for downloading with dio. I did have to tweak the build.grade file and set SDK to 29 along with bumping down some of the plugin versions.

Thank you so much @cbanaspk you saved my time though all features are not available(Like pause, resume, and showing progress in the notification bar) but this will be okay for the initial release of my app.

utsav-savani avatar Jul 14 '21 04:07 utsav-savani

I believe flutter downloader does not work with android 11

For Flutter_Downloader If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

I did the line is already added but still, issue in Android 11

https://www.youtube.com/watch?v=3gNd1Ma-gss&list=FLcgfafWRwPYXKs6NliCs5Xw&index=1&t=85s. Along with that video, this tutorial https://medium.com/@michallot/how-to-write-a-simple-downloading-app-with-flutter-2f55ae516867 helped with displaying notifications for downloading with dio. I did have to tweak the build.grade file and set SDK to 29 along with bumping down some of the plugin versions.

Thank you so much @cbanaspk you saved my time though all features are not available(Like pause, resume, and showing progress in the notification bar) but this will be okay for the initial release of my app.

https://pub.dev/packages/flowder Check this package where you can find pause, resume features

arshadbarves avatar Jul 14 '21 06:07 arshadbarves

I believe flutter downloader does not work with android 11

For Flutter_Downloader If you are using API 29+(ANDROID 10 and Above) add the below code in AndriodManifest.xml

android:requestLegacyExternalStorage="true"

Like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">  

    
    ...........
  
    <application
        ..............
        <!-- Add This line -->

        tools:replace="android:label" 
        android:requestLegacyExternalStorage="true"> <!-- Add This line if you are targeting android API 29+-->

        <activity>
            ...............
        </activity>
     
    </application>
</manifest>

I did the line is already added but still, issue in Android 11

https://www.youtube.com/watch?v=3gNd1Ma-gss&list=FLcgfafWRwPYXKs6NliCs5Xw&index=1&t=85s. Along with that video, this tutorial https://medium.com/@michallot/how-to-write-a-simple-downloading-app-with-flutter-2f55ae516867 helped with displaying notifications for downloading with dio. I did have to tweak the build.grade file and set SDK to 29 along with bumping down some of the plugin versions.

Thank you so much @cbanaspk you saved my time though all features are not available(Like pause, resume, and showing progress in the notification bar) but this will be okay for the initial release of my app.

https://pub.dev/packages/flowder Check this package where you can find pause, resume functionalities

arshadbarves avatar Jul 14 '21 06:07 arshadbarves

How did you fix the issue @arshadbarves ?

jigarfumakiya avatar Aug 25 '21 05:08 jigarfumakiya

I did not added release of my app for Android 11.0. I still did not get any solution, as the file does not open on clicking the notification bar.

On Wed, Aug 25, 2021, 11:22 AM Jigar Fumakiya @.***> wrote:

How did you fix the issue @arshadbarves https://github.com/arshadbarves ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/fluttercommunity/flutter_downloader/issues/486#issuecomment-905203965, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVJ6YKGEW7NPRK553XHIFTT6SAKRANCNFSM47UJGVJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

utsav-savani avatar Aug 25 '21 06:08 utsav-savani

Yes, better to move on with other plugins Thanks

jigarfumakiya avatar Aug 25 '21 09:08 jigarfumakiya

please same issue to me . is there any solution to fix it?

ItdaTeam avatar Aug 31 '21 02:08 ItdaTeam

One is you can write your native code but no fix from official team.

On Tue, Aug 31, 2021, 8:00 AM ItdaTeam @.***> wrote:

please same issue to me . is there any solution to fix it?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/fluttercommunity/flutter_downloader/issues/486#issuecomment-908847255, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVJ6YI6R6LVYM4KKLM3YULT7Q5GFANCNFSM47UJGVJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

utsav-savani avatar Aug 31 '21 03:08 utsav-savani

@utsav-savani I am also facing the same problem, the file is not getting open automatically via code, neither it is opening on clicking on the notification. Also, my flutter version is very old. Please find the issue on #599

Can you help me if there is any solution? The end goal is to automatically open the file for the user after it is downloaded successfully.

Vikasosian avatar Jan 28 '22 19:01 Vikasosian

Are there any news? I have the same problem. File get downloaded, but I can't open it via notification neither with .open method. Android 10.

adminant avatar Apr 08 '22 21:04 adminant

Issue is still there file is downloaded but not opening when notification is tapped tested on android 10,11,12,13

farooq958 avatar Mar 03 '23 07:03 farooq958