flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

why i can't open the file from notifications

Open billbull21 opened this issue 4 years ago • 10 comments

image

as the shown above... i do set true for the openFileFromNotification. but still i can't opened my file. please help me...

and how can i handle if my download was succesfull ?

regards

billbull21 avatar May 18 '20 13:05 billbull21

Same with me, I have put the file into external storage, but I can't open it either

chengxushi avatar May 26 '20 06:05 chengxushi

i already known my own problem... the problem is the file was downloaded is failed to save/write into storage.. which is, i opened my file from spesific directory.

my solution is very ez,, you should be give a permission to write into storage

billbull21 avatar May 26 '20 08:05 billbull21

You need to include the lines in the manifest AS WELL AS have the user explicity grant .storage permission

hawkinsjb1 avatar Jun 08 '20 20:06 hawkinsjb1

I can open file from notifications on API 28 but not API 30

martinlundhgren avatar Oct 28 '20 14:10 martinlundhgren

You might add the storage permissions in manifest but your phone may either way say that this permission is denied. Make sure that your app REQUESTS user to grant permission to access storage.

lukeurban avatar Dec 15 '20 10:12 lukeurban

I can open file from notifications on API 28 but not API 30

Try adding this line "android:requestLegacyExternalStorage="true"" to your Android.manifest file in the application tag <application android:label="login" android:icon="@mipmap/ic_launcher" android:requestLegacyExternalStorage="true">

Coding-avatar avatar May 30 '21 20:05 Coding-avatar

Even I cannot open the file on clicking the notification, what to do ? I want to open my downloaded pdf document directly from notification

Akshat7321 avatar Jun 05 '21 13:06 Akshat7321

I am also having the same issue. Deos anyome have a solution

temwa avatar Jun 05 '21 19:06 temwa

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

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>

this solved the problem! thanks!

carsonwyf avatar May 31 '22 17:05 carsonwyf