termux / termux/termux-api

Documenting termux-notification-list

Open Beginner friendly
#575 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

I wrote this basic documentation (which I was unable to add to the locked wiki).
A new page needs making and linking to from https://wiki.termux.com/wiki/Termux:API

Here is what I wrote:

termux-notification-list

The termux-notification-list API command lists Android system notifications from other apps in the format of a JSON list of notification objects. For example, this might be useful to make a a script that detects when a particular notification is received, e.g: after a reminder app has a reminder notification, a script could do some custom action like turning on the torch by polling this command.

Usage

termux-notification-list
The output of the command is like this:

[
    {
        "id": -100,
        "tag": "",
        "key": "0|com.example_organisation.app_name|-100|null|10151",
        "group": "APP_NAME_ONGOING_NOTIFICATION",
        "packageName": "com.example_organisation.app_name",
        "title": "Notification title",
        "content": "Notification content",
        "when": "292269055-12-02 16:47:04",
        "lines": [
        "Text from the notification"
        ]                                                               
    },
    {
        "id": -100,
        "tag": "",
        "key": "0|com.example_organisation.app_name|-100|null|10151",
        "group": "APP_NAME_ONGOING_NOTIFICATION",
        "packageName": "com.example_organisation.app_name",
        "title": "Notification title",
        "content": "Notification content",
        "when": "292269055-12-02 16:47:04",
        "lines": [
        "Text from the notification"
        ]                                                               
    }
]

Source code.

Permissions

On some Android versions, allowing permission to notifications can be tricky. Please add more detailed steps here that worked for you.

See also

https://wiki.termux.com/wiki/Termux-call-log
https://wiki.termux.com/wiki/Termux-notification (to produce a new notification)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked app/src/main/java/com/termux/api/apis/NotificationListAPI.java source and the existing Termux:API wiki page. Create and link a termux-notification-list page containing the supplied usage, JSON output, source link, permissions guidance, and See also links; done means the new page is reachable from Termux:API.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.