fluttercommunity / flutter_downloader

Flutter Downloader - A plugin for creating and managing download tasks.
https://pub.dev/packages/flutter_downloader
BSD 3-Clause "New" or "Revised" License
905 stars 508 forks source link

File not opening on clicking on Notification bar #486

Open utsav-savani opened 3 years ago

utsav-savani commented 3 years ago

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

cbanaspk commented 3 years ago

I believe flutter downloader does not work with android 11

utsav-savani commented 3 years ago

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

cbanaspk commented 3 years ago

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.

utsav-savani commented 3 years ago

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 .

cbanaspk commented 3 years ago

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.

arshadbarves commented 3 years ago

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 commented 3 years ago

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>
utsav-savani commented 3 years ago

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

cbanaspk commented 3 years ago

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.

utsav-savani commented 3 years ago

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.

arshadbarves commented 3 years ago

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 commented 3 years ago

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

jigarfumakiya commented 3 years ago

How did you fix the issue @arshadbarves ?

utsav-savani commented 3 years ago

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 .

jigarfumakiya commented 3 years ago

Yes, better to move on with other plugins Thanks

ItdaTeam commented 3 years ago

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

utsav-savani commented 3 years ago

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.

Vikasosian commented 2 years ago

@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.

adminant commented 2 years ago

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.

farooq958 commented 1 year ago

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