Skip to content

v1.61.0(dev)

Latest

Choose a tag to compare

@Fector101 Fector101 released this 04 Jun 13:12
· 6 commits to main since this release

Highlights:

  • Simplified Installation.
  • Ability to make Custom sound through file path.
  • A CLI command to clear old versions from .buildozer

Code Sample

Simplified Installation

  • For install simply add android-notify to your dependencies list, android-notify will auto check if you're using androidx or not

On Kivy

requirements = python3, kivy, pyjnius, android-notify
android.permissions = POST_NOTIFICATIONS

On Flet

[tool.flet.android]
dependencies = [
  "pyjnius","android-notify"
]

[tool.flet.android.permission]
"android.permission.POST_NOTIFICATIONS" = true

On Pydroid3

Open the side bar chose pip and Enter android-notify in input box for Library name

Custom Sound through Local file path or URI

You can use a local audio file path, a content://, file://, or android.resource:// URI directly:

# Using a local file path
Notification.createChannel(
    id="local_sound",
    name="Local Sound",
    sound_path="/storage/emulated/0/Download/alert.mp3"
)

# Using a content URI (e.g., from media store)
Notification.createChannel(
    id="uri_sound",
    name="URI Sound",
    sound_path="content://media/external/audio/media/123"
)

# Send notification with custom sound path
n = Notification(
    title="Custom Sound",
    message="Playing from local path",
    channel_id="local_sound"
)
n.setSound(sound_path="/storage/emulated/0/Download/alert.mp3")
n.send()

Private files (e.g., in app's data/ directory) are automatically copied to external storage before playing.

Command to remove old versions

  • To clear old versions from your project dir run android-notify prune