Allows saving files to a scoped storage on Android 10+
npm install filesaver
npx cap sync
for open intent res/file_path.xml
don't forget to add provider after package name in authorities <provider android:name="androidx.core.content.FileProvider" android:authorities="com.example.androidlldownloadandviewfile.provider" android: exported="false" android: granturiPermissions="true"
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource."@xml/file_path" />
saveToDownloads(options: { url: string; fileName: string; }) => Promise<{ downloadId: number; }>
Param | Type |
---|---|
options |
{ url: string; fileName: string; } |
Returns: Promise<{ downloadId: number; }>
stopDownload(options: { id: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ id: number; } |