termux-api icon indicating copy to clipboard operation
termux-api copied to clipboard

termux-notification actions don't work

Open ErrrorMaxx opened this issue 1 year ago • 2 comments

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

  • termux-api application version: 0.50.1+b732327
  • termux-api package version (installed through apt): 0.58.0
  • Android OS version: 13
  • Device model: Tecno Camon 20 Pro 5G

ErrrorMaxx avatar Jan 05 '24 23:01 ErrrorMaxx

termux-wake-lock termux-notification -i sshd

BruceLee027 avatar Feb 06 '24 00:02 BruceLee027

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

ErrrorMaxx avatar Feb 12 '24 05:02 ErrrorMaxx

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

ErrrorMaxx avatar Apr 26 '24 15:04 ErrrorMaxx

Have you done any research where the problem is?

SpaceEngineer17 avatar Apr 26 '24 16:04 SpaceEngineer17

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

ErrrorMaxx avatar Apr 26 '24 16:04 ErrrorMaxx

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.

SpaceEngineer17 avatar Apr 27 '24 10:04 SpaceEngineer17

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

ErrrorMaxx avatar Apr 27 '24 10:04 ErrrorMaxx

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.

sylirre avatar Apr 27 '24 11:04 sylirre

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.

SpaceEngineer17 avatar Apr 27 '24 15:04 SpaceEngineer17