Giter Site home page Giter Site logo

Comments (6)

781flyingdutchman avatar 781flyingdutchman commented on September 15, 2024

Fair question. It would be possible to set it up that way, but if you wake up the app for every background event of the downloader (typically including progress updates that happen very frequently) then the app isn't really running in the background anymore, which is the whole point of background downloading.

Can you elaborate on the use case you'd have for this (other than avoiding a few extra lines on wakeup)?

Let me look into if it's possible to configure a wakeup for final state - but even then you'd still have to process what happened when the app was truly in the background.

from background_downloader.

tomasweigenast avatar tomasweigenast commented on September 15, 2024

I saw the source code and the package does nothing when the app is terminated (because it saves the state to SharedPreferences, on Android, I did not see code to awake the app when WorkManager fires events), correct me if I'm wrong.

I don't mean to awake the app for every possible event (could be left to the developer). In my use case, the app must receive an event when a background upload is finished, even if the app was terminated because it needs to call an HTTP endpoint.

Currently, I'll try to solve that requirement using the background_fetch package (https://pub.dev/packages/background_fetch) which runs a callback every 15 min. approx and then check if the task was completed or not.

from background_downloader.

781flyingdutchman avatar 781flyingdutchman commented on September 15, 2024

Correct, right now the plugin does not wake up the app. What I was suggesting is that perhaps I could add an option to do that only for a final state. That would presumably solve your issue, but I have to think about this a bit.

from background_downloader.

tomasweigenast avatar tomasweigenast commented on September 15, 2024

Yes, I think implementing that for a final state is good. I don't know if you can set up "hooks" for WorkManager or JobManager to call a function when the upload/download finishes even if the app is terminated.

from background_downloader.

github-actions avatar github-actions commented on September 15, 2024

This issue is stale because it has been open for 14 days with no activity.

from background_downloader.

github-actions avatar github-actions commented on September 15, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

from background_downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.