Skip to content

Add share action and request notification permission#2365

Open
ulchin2 wants to merge 1 commit intoJunkFood02:mainfrom
ulchin2:main
Open

Add share action and request notification permission#2365
ulchin2 wants to merge 1 commit intoJunkFood02:mainfrom
ulchin2:main

Conversation

@ulchin2
Copy link

@ulchin2 ulchin2 commented Jan 7, 2026

📌 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:

  1. Post-download sharing friction
    Adding a Share action directly in the notification streamlines this workflow.

  2. 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.kt

  • Introduced 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.kt

    • DownloaderV2.kt

  • Triggered only when a single file download is completed

  • Uses the system share sheet for a native Android experience

🛡️ Android 13+ Notification Permission

  • Requests POST_NOTIFICATIONS permission on app start (API 33+)

  • Implemented in MainActivity.kt

  • Includes a preference flag to prevent repeated permission prompts
    (PreferenceUtil.kt)


🧩 Files Changed

File | Description -- | -- NotificationUtil.kt | Adds support for notification actions Downloader.kt | Share action on single-file completion DownloaderV2.kt | Share action on single-file completion MainActivity.kt | Notification permission request (API 33+) PreferenceUtil.kt | Stores flag to avoid re-prompting permission

📱 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

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

Successfully merging this pull request may close these issues.

1 participant