termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.34k stars 459 forks source link

termux-notification actions don't work #653

Closed ErrrorMaxx closed 6 months ago

ErrrorMaxx commented 10 months ago

Problem description

Instead of executing termux-notification button's action, wakelock is stopped and no action really executed

Steps to reproduce

termux-wake-lock
termux-notification -i sshd -c '...' --priority max --ongoing --button1 'Stop' --button1-action 'termux-notification-remove sshd'

and press 'Stop' button on notification

Expected behavior

Wakelock is still here and action actually works

Additional information

BruceLee027 commented 9 months ago

termux-wake-lock termux-notification -i sshd

ErrrorMaxx commented 9 months ago

... Notifications itself works (shows). Click actions works. Button actions DO NOT

ErrrorMaxx commented 6 months ago

I think this is actually the same issue as in https://github.com/termux/termux-api/issues/677

Because after this line:

termux-notification --action "termux-dialog" -t Suspicious -c NotReally

This line now works:

termux-notification -i sshd -c '...' --priority max --ongoing --button1 'Stop' --button1-action 'termux-notification-remove sshd'

But incurrectly: Button1 works, but runs termux-dialog instead of termux-notification-remove sshd

Closing this issue in favor of https://github.com/termux/termux-api/issues/677

SpaceEngineer17 commented 6 months ago

Have you done any research where the problem is?

ErrrorMaxx commented 6 months ago

No, I'm not. But problem gone after downgrading to latest release

SpaceEngineer17 commented 6 months ago

When downgraded, SAF scripts aren't working.

Source code is same, does that mean build process/gradle scripts/ext. Libs affecting the App or something interesting happening in the code, I wonder.

ErrrorMaxx commented 6 months ago

I don't understand what do you mean by "source code is same". SAF was implemented literally way later than latest release happened. So latest release is actually really old version

sylirre commented 6 months ago

Yeah, these changes are not released. If you want SAF, please use Git build of Termux:API.

See changes since the latest release: https://github.com/termux/termux-api/compare/v0.50.1...master

Scripts are not standalone. If feature missing in Termux:API app, these scripts won't work.

SpaceEngineer17 commented 6 months ago

Oh, I thought the latest build (v0.50.1) was made with the present source code.

Now I understood they are different. Thank you.

So the termux-notification actions bug might came from one of these changes , I guess.