Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Per-Request Notification Control #703

Open
AlvaroZapp opened this issue Jan 8, 2025 · 0 comments
Open

Add Support for Per-Request Notification Control #703

AlvaroZapp opened this issue Jan 8, 2025 · 0 comments

Comments

@AlvaroZapp
Copy link

Hi,

First, thank you for the amazing Fetch2 library—it’s been incredibly useful for managing downloads in our projects!

I’d like to propose a feature enhancement that could be valuable for many use cases: per-request notification control. Currently, Fetch2’s NotificationManager applies globally to all downloads, which means it’s not possible to selectively enable or disable notifications for individual requests. This limitation can be problematic in scenarios where some downloads need to be "silent" (e.g., no notification) while others should display progress notifications.

Example Use Case:
Imagine an application where:

  1. Some downloads (e.g., user-initiated media files) require progress notifications to inform the user.
  2. Other downloads (e.g., background updates or preloaded data) should run silently without interrupting the user.

Suggested Solution:
Add a flag or property in the Request class to specify whether notifications should be shown for that particular download. For example:

val request = Request(url, filePath)
request.showNotification = true // Default true

This flag could then be checked in the NotificationManager to decide whether to create and display a notification for that specific download.

Benefits:

  • Greater flexibility for developers to manage notifications on a per-download basis.
  • Aligns with common patterns where not all background operations require user visibility.
  • Reduces the need for workarounds, such as custom NotificationManager implementations or dynamic filtering mechanisms.

I believe this addition would enhance Fetch2’s versatility and provide a smoother experience for developers and users alike.

Thank you for considering this feature request! Please let me know if I can provide more details or contribute to its implementation.

Best regards,
Álvaro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant