android-upload-service icon indicating copy to clipboard operation
android-upload-service copied to clipboard

Notifications cannot be disabled

Open 39otrebla opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. In our Application we have both (potentially) long-running uploads and very quick ones (<1 MB). For the latter case, we don't want a Notification to appear.

Also, there are use cases where it is important that the upload continues if the app is sent to background (so it makes sense to use this library), but the upload itself is a non-core feature (or even something the user didn't start voluntarily), so it doesn't make sense to show a notification.

Describe the solution you'd like I'd like to have a setter to enable/disable notifications on a Request instance (not globally).

Describe alternatives you've considered An alternative would be to create a Notification Channel with the lowest priority, and then use it via UploadNotificationConfig. But in this way:

  • it would still be visible in Application Settings
  • it would still require a lot of configuration (progress StatusConfig, error StatusConfig, etc, etc) for something that no one in team would even want to show

Are you willing to implement it and maintain it?

  • [ ] Yes
  • [X] Can implement it with a Pull Request, but not maintain it
  • [ ] No

39otrebla avatar Aug 19 '22 18:08 39otrebla

Google requires the notification to appear within 5 seconds after service is started, so the notification is always needed, otherwise you will have a crash.

They have posed increasing limitations and constraints on Services, to promote using WorkManager instead.

When the library was born and up to Android 8 your use case was fully supported, but afterwards, as a result of increasing limitations and constraints, the library had become best suited for user initiated uploads which may require some time and for which you want to show a progress.

gotev avatar Aug 19 '22 20:08 gotev

Are you implicitly saying that addressing #610 would unblock this feature?

39otrebla avatar Aug 20 '22 17:08 39otrebla

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '22 20:10 stale[bot]