nativescript-background-task
nativescript-background-task copied to clipboard
How to get download progress?
Hello,
Is there any way to get the download progress with this plugin. It appears that this is not the case according to the documentation but I just want to make sure.
Thanks in advance.
I see on IOS this file gets created as the file is downloading: ./tmp/CFNetworkDownload_z3OTk8.tmp
Is there a way to change the filename so I can identify it?
If I can do that then Its simply a matter of comparing the file size of this file vs the total file size.
Hi,
The plugin does not have this option.
in the case of IOS, we would only have to set a progress listener.
https://github.com/mobilemindtec/nativescript-background-task-ios-source/blob/master/NSBackgroundTask/Classes/NSBackgroundTaskHttpRequestToFile.m
In the case of android, we would have a little more work.
https://github.com/mobilemindtec/nativescript-background-task/blob/master/native-src/android/app/src/main/java/br/com/mobilemind/ns/task/HttpRequestToFileTask.java