Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does termux:API work? #190

Closed
shanness opened this issue Jan 21, 2019 · 4 comments
Closed

How does termux:API work? #190

shanness opened this issue Jan 21, 2019 · 4 comments
Labels

Comments

@shanness
Copy link

Hey,

Great project! Just wondering how the termux:API is designed to be used? Does it require ntfy on the phone?

@dschep
Copy link
Owner

dschep commented Jan 21, 2019

Yup, it's intended for use entirely on your phone. Think of it as the Android equivalent of the windows/darwin/linux backend for desktop computers.

To use it follow these steps:

  1. install Termux https://play.google.com/store/apps/details?id=com.termux
  2. install Termux:API https://play.google.com/store/apps/details?id=com.termux.api
  3. open Termux
  4. install termux api client: apt install termux-api
  5. install ntfy: pip install ntfy
  6. Test it!: ntfy -b termux send test

let me know if you have any issues, it was built mostly as a curiosity and I haven't used it since I first implemented and tested it.

@dschep dschep closed this as completed Jan 21, 2019
@Dan1jel
Copy link

Dan1jel commented Jun 2, 2022

Got this error when I try to send a message via Termux, i use the F-Droid version because google play is not updated anymore.

Edit, forgot the error code :P

command ntfy -b termux send test
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/ntfy", line 8, in
sys.exit(main())
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/ntfy/cli.py", line 329, in main
config = load_config(DEFAULT_CONFIG)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/ntfy/config.py", line 45, in load_config
if 'backend' in config:
TypeError: argument of type 'NoneType' is not iterable

@Dan1jel
Copy link

Dan1jel commented Jan 16, 2023

Tried this again after using a different method, but now I get this error instead (termux and termux-api is installed via F-droid instead due to Google Play version is outdated).

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/ntfy", line 5, in <module>
    from ntfy.cli import main
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/ntfy/__init__.py", line 6, in <module>
    from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (/data/data/com.termux/files/usr/lib/python3.11/inspect.py)

@dschep
Copy link
Owner

dschep commented Feb 3, 2023

Hey @Dan1jel, it looks like inspect.getargspec was removed in python 3.11. I created #262 to track this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants