Skip to content

Conversation

@Fector101
Copy link
Owner

Useful for Saving and Getting Data from Notification

  • NotificationHandler.data_object returns a dict of data in the clicked notification
  • setData can also be called after send to change data_object stored
from android_notify import Notification, NotificationHandler

    def build(self):
        notification = Notification(title="Hello")
        notification.setData({"next wallpaper path": "test.jpg"})
        notification.send()

    def on_start(self):
        notification_data = NotificationHandler.data_object  # {"next wallpaper path": "test.jpg",...}
        print(notifcation_data)

    def on_resume(self):
        notification_data = NotificationHandler.data_object  # {"next wallpaper path": "test.jpg",...}
        print(notifcation_data)

@Fector101
Copy link
Owner Author

Scoped tests passed

@Fector101 Fector101 merged commit 7c14974 into main Jan 18, 2026
1 check passed
@Fector101 Fector101 deleted the feat-add-data-to-notification branch January 19, 2026 22:19
@Fector101 Fector101 restored the feat-add-data-to-notification branch January 19, 2026 22:19
@Fector101 Fector101 deleted the feat-add-data-to-notification branch January 19, 2026 22:19
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.

2 participants