binwiederhier / ntfy-android

Android app for ntfy.sh
Apache License 2.0
520 stars 108 forks source link

Are you considering supporting the java version? #92

Open WangkeqiangS opened 2 weeks ago

WangkeqiangS commented 2 weeks ago

Our project is old and uses java language, while ntfy is kotlin version, how should we deal with it?

deathbarn commented 2 weeks ago

I'm not sure what you're trying to do, but Java and Kotlin are compatible.

WangkeqiangS commented 2 weeks ago

How can I quickly integrate ntfy functionality into a project?

deathbarn commented 2 weeks ago

I think this will be helpful. https://docs.ntfy.sh/subscribe/phone/#integrations

WangkeqiangS commented 2 weeks ago

thank you for the response,Our project needs the function of message notification, now we find that ntfy is very suitable for us, and we can also receive messages through the demo you provided, but the problem now is that I don't know how to integrate the functions of ntfy into my own project, may I ask whether this is possible?

deathbarn commented 2 weeks ago

I think you'll need to refer to the ntfy source code and API documentation to implement topic subscriptions and notification handling. https://docs.ntfy.sh/subscribe/api/

WangkeqiangS commented 2 weeks ago

Can I understand that by copying ntfy source code into our project, we can use ntfy functionality?

deathbarn commented 2 weeks ago

That’s correct. Upon further search, I found a library that allows using ntfy with Java. I think this could be useful. https://github.com/MaheshBabu11/ntfy-java/ https://github.com/binwiederhier/ntfy/blob/main/docs/integrations.md

WangkeqiangS commented 2 weeks ago

Thanks, I am an Android project, this library is server-side java, may not be suitable for me. I'm a little confused, nfty's Android source code is a bit excessive, how do I copy the source code into my own project?

WangkeqiangS commented 2 weeks ago

thank you very much,But the problem is that ntfy has a lot of source code, and there are few comments in the demo, Where should I start copying the source code?

deathbarn commented 2 weeks ago

I'm not very familiar with ntfy, so I might be off the mark.

app/src/main/java/io/heckel/ntfy/service/*
app/src/main/java/io/heckel/ntfy/msg/ApiService.kt
WangkeqiangS commented 2 weeks ago

Do you mean to copy from the code under the service package first?