Add share action and request notification permission#2365
Open
ulchin2 wants to merge 1 commit intoJunkFood02:mainfrom
Open
Add share action and request notification permission#2365ulchin2 wants to merge 1 commit intoJunkFood02:mainfrom
ulchin2 wants to merge 1 commit intoJunkFood02:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
This change adds a Share action to completed download notifications and ensures proper notification delivery on Android 13+ (API 33) by requesting notification permission at app startup.
🎯 Motivation
Two main issues were addressed:
Post-download sharing friction
Adding a Share action directly in the notification streamlines this workflow.
Notification visibility on Android 13+
Starting with Android 13, apps must explicitly request notification permission. Without this, users may never see download completion notifications.
✨ What’s New
🔔 Notification Improvements
Added notification action support via
NotificationUtil.ktIntroduced a Share action for single-file download completion
Allows users to instantly share files directly from the notification
📤 Share Action on Download Completion
Implemented in:
Downloader.ktDownloaderV2.ktTriggered only when a single file download is completed
Uses the system share sheet for a native Android experience
🛡️ Android 13+ Notification Permission
Requests
POST_NOTIFICATIONSpermission on app start (API 33+)Implemented in
MainActivity.ktIncludes a preference flag to prevent repeated permission prompts
(
PreferenceUtil.kt)🧩 Files Changed
📱 Android Version Compatibility
✅ Android 12 and below: No behavior change
✅ Android 13+ (API 33): Notification permission requested once
🔁 Permission request is not repeated after user decision
✅ Benefits
Faster sharing workflow
Improved UX after downloads
Compliance with modern Android permission requirements
No breaking changes
📝 Notes
Share action is only shown for single-file downloads
No additional permissions are requested on older Android versions