Giter Site home page Giter Site logo

gotify / android Goto Github PK

View Code? Open in Web Editor NEW
824.0 20.0 141.0 4.96 MB

An app for creating push notifications for new messages posted to gotify/server.

License: MIT License

Java 43.58% Scala 0.37% Shell 0.62% Kotlin 55.43%
fdroid gotify playstore android java push-notifications

android's Introduction

Gotify Android Build Status FOSSA Status latest release version F-Droid

Gotify Android connects to gotify/server and shows push notifications on new messages.

Features

  • show push notifications on new messages
  • view and delete messages

Installation

Download the apk or get the app via F-Droid or Google Play.

Get it on Google Play Get it on F-Droid Get it on F-Droid

Google Play and the Google Play logo are trademarks of Google LLC.

Disable battery optimization

By default Android kills long running apps as they drain the battery. With enabled battery optimization, Gotify will be killed and you wont receive any notifications.

Here is one way to disable battery optimization for Gotify.

  • Open "Settings"
  • Search for "Battery Optimization"
  • Find "Gotify" and disable battery optimization

See also https://dontkillmyapp.com for phone manufacturer specific instructions to disable battery optimizations.

Minimize the Gotify foreground notification

Only possible for Android version >= 8

The foreground notification showing the connection status can be manually minimized to be less intrusive:

  • Open Settings -> Apps -> Gotify
  • Click Notifications
  • Click on Gotify foreground notification
  • Toggle the "Minimize" option / Select a different "Behavior" or "Importance" (depends on your Android version)
  • Restart Gotify

Message Priorities

Notification Gotify Priority
- 0
Icon in notification bar 1 - 3
Icon in notification bar + Sound 4 - 7
Icon in notification bar + Sound + Vibration 8 - 10

Building

Use Java 17 and execute the following command to build the apk.

$ ./gradlew build

Update client

  • Run ./gradlew generateSwaggerCode
  • Discard changes to client/build.gradle (newer versions of dependencies)
  • Fix compile error in client/src/main/java/com/github/gotify/client/auth/OAuthOkHttpClient.java (caused by an updated dependency)
  • Delete client/settings.gradle (client is a gradle sub project and must not have a settings.gradle)
  • Commit changes

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

android's People

Contributors

chunfengyao avatar cyb3rko avatar dylanparker avatar gjabell avatar hugegreenbug avatar ialokim avatar jmattheis avatar krosf avatar leopoldsedev avatar mzoeller avatar newhinton avatar ngruychev avatar p1gp1g avatar pandermusubi avatar quthla avatar remirigal avatar rorpage avatar schwma avatar sgpublic avatar sternagfonkel avatar tomasvanagas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android's Issues

WebSocket: failure StatusCode: 400 Message

I'm seeing constant errors of this form (see subject) in the app logs on the device. The stack trace in the log doesn't look too terribly useful, but I can supply it if it's helpful.

Meanwhile, the Gotify persistent connection notification shows "Could not connected Bad Request", which is obviously the result of this error.

Attaching to the server console, I'm seeing instances of this error, which I suspect is related:

Error #1: websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header

For reference, this is using the latest docker server image and the latest version of the app published on the Play store on a Pixel 3 running Android Q.

Ultimately, I'm seeing no push notifications on the device, and I can only assume this is related (my guess is the websocket exception is thrown before the notification can be published, but I haven't looked at the code so that really is wild speculation).

Let me know if there's any other information I can supply that might help diagnose this issue!

Clear notification dot and notification bar automatically by app start

When a gotify message was receive during my absence and i wake up the phone i see on the my first/home screen the gotify icon with a blue notification dot. (Android 8) That is expected behaviour.

When i start the app, read the message, clear the message and exit the app the notification dot is not removed from app icon beacause the notification is still in the notification bar. I have to clear the notification bar manually too.

Is it possible after starting the app and reading the messsages to clear the notification bar and dot automatically?

v2.0.6: How make a carriage return in messages now?

From client version 2.0.6 the "\n" is ignored and the send text messages and displayed as single line.
Is that due to the markdown implementation?
What is now the right character in the textmessage to have a carriage return?

Better Multiuser support?

Hey!

First of all thanks for this awesome project!

I checked out pushjet but they make people buy their App (i would, but i dont have Google in my phone 🙄)... So gotify comes in handy and i really like it.

I made an application for my smart home that can send me notifications for smoke or water detectors.
I'd like to have my wife also receive those.
The only possible way right now seems to use one user /account on both devices.

However i'd like to not bother my wife with my Servers status....

I suggest

  • to make it possible to share applications/tokens among multiple users
  • to make notifications possible that each user can / has to Mark read / seen for him/herself

Or is it possible already somehow?

Maybe that is something that can be combined with the multiserver feature someone asked for.

Thanks!

Suggestion: Option to mute an app

Some apps have a high number of notifications and others a low number but we don't want to miss those. Muting the chatty app until we can get back to it would be nice.

Directly copy & share from notification bar

It would be more convenient if gotify provides two buttons (copy and share the contents) in the notification bar (under the pushing message, just like "mark as read" and "reply" for IM apps). Correspondingly, a useful option could be that the click of one of these buttons will also automatically clear the notification. However, the hard problem for this feature could be concluded as “what to copy” since I think many users wouldn’t like to share the text organized by markdown. However, copying entire message in plain text will omit the images as well as saving the message as a html file would not be handy for most users. IMO a possible solution could be providing users two options including share and open (see my comment below). If the message just contains a link of one image, (saves and) shares this image. Otherwise shares plain text. Besides, when users click the notification and open the gotify app, provides them an option (e.g., long press the message) to export whole text as markdown or plaintext to the storage.

Besides, it would be great if the app allows users to choose the copy whether or not including the title.

Thanks for consideration.

Tasker integration

Tasker is a powerful scripting system with unlimited possibilites. Integrating it with Gotify, will add another dimension to it:)
Tasker would react on Gotify's messages from defined apps or on a keywords/regex found in messages by running a user's defined script.
F.ex:

  • send http request to a server
  • play alarm sound
  • write sms
  • download a file from link in the message

Here is link to the documentation:
https://tasker.joaoapps.com/plugins.html

Markdown Inline-style links not rendering

gotify/android v2.0.6
gotify/server v2.0.4

Sending an Inline-style link using Markdown doesn't render the link on the android app but does correctly on the server app.

[This is the text](https://github.com)

Sending the above message on android results in only getting "This is the text" without it linking to anything.

Setting the number of vibrations when receiving a notification.

Hello
Congratulations and thank you for this great application.
I use this app to receive notifications from a sick person - my father - monitoring system.
It works perfectly but I would like to have an additional setting.
That is, I would like to be able to set the number of vibrations from 1 to 5 when I receive a notification.
Indeed currently there is only one vibration, which is often not enough to wake me up. So if I could adjust the number of vibrations to 3 or 5 for example, I would be sure to wake up so as to treat my father.
Thank you in advance and congratulations for your work and sharing.

Add explanation about battery saving

Normally android kills processes which run for a long time in background, this can and should be deactivated, to ensure that messages are delivered correctly.

Support multiple servers

It will be awesome if the app can connect to multiple servers at once. Can be kinda of poor man high availability implementation:

A script tries to send a notification to server1.com if it's down it tries server2.com and because the android client is connected to both, you still get the notification.

Thank you.

Make message contents richer

Would be great to add some rich content to the messages. Preferable html or some markdown. I would like to attach images inside the messages.

BTW: Is there a possibility to send EOL character in the message when using cUrl?

Android app doesn't connect to server

Hi, apologies if I'm just doing something wrong, but I can't seem to get my Android client to sync up with the server. I have it running on a non-standard port (8118), and am able to connect to the server with my username and password. I can also see updates in the server log when I pull down to refresh on Android.

[GIN] 2019/01/11 - 17:00:02 | 200 |     554.496µs |     192.168.1.1 | GET      /stream?token=XXXXXXXXXXXX
[GIN] 2019/01/11 - 17:00:02 | 200 |     799.695µs |     192.168.1.1 | GET      /application
[GIN] 2019/01/11 - 17:00:02 | 200 |     868.698µs |     192.168.1.1 | GET      /message?limit=100&since=0

However, there are no messages. Through the terminal I can create messages, and I see them in the server web UI, but nothing on my phone.

Also, even though I have logged in to the server from Android, the device does not appear in the list of clients.

Server log of starting gotify and adding my Android client:

$ sudo ./gotify-linux-amd64
Starting Gotify version 1.2.1@2018-12-12-21:08:19
Started Listening on port 8118
[GIN] 2019/01/11 - 17:06:04 | 200 |     210.118µs |     192.168.1.1 | GET      /version 
[GIN] 2019/01/11 - 17:06:15 | 200 |   52.376055ms |     192.168.1.1 | GET      /current/user
[GIN] 2019/01/11 - 17:06:21 | 200 |   62.132179ms |     192.168.1.1 | POST     /client
[GIN] 2019/01/11 - 17:06:21 | 200 |     661.908µs |     192.168.1.1 | GET      /current/user
[GIN] 2019/01/11 - 17:06:21 | 200 |     102.729µs |     192.168.1.1 | GET      /version
[GIN] 2019/01/11 - 17:06:21 | 200 |     917.238µs |     192.168.1.1 | GET      /message?limit=1&since=0
[GIN] 2019/01/11 - 17:06:21 | 200 |      898.51µs |     192.168.1.1 | GET      /stream?token=C8VbjR_XXXXX
[GIN] 2019/01/11 - 17:06:21 | 200 |     777.636µs |     192.168.1.1 | GET      /application
[GIN] 2019/01/11 - 17:06:21 | 200 |    2.197495ms |     192.168.1.1 | GET      /message?limit=100&since=0
[GIN] 2019/01/11 - 17:06:36 | 200 |      153.26µs |       127.0.0.1 | GET      /
[GIN] 2019/01/11 - 17:06:36 | 200 |     516.369µs |       127.0.0.1 | GET      /current/user
[GIN] 2019/01/11 - 17:06:36 | 200 |     132.877µs |       127.0.0.1 | GET      /static/css/main.c1fdf91b.css
[GIN] 2019/01/11 - 17:06:36 | 200 |     263.933µs |       127.0.0.1 | GET      /static/js/main.d0fe35f1.js
[GIN] 2019/01/11 - 17:06:36 | 200 |      223.44µs |       127.0.0.1 | GET      /current/user
[GIN] 2019/01/11 - 17:06:36 | 200 |      16.957µs |       127.0.0.1 | GET      /version
[GIN] 2019/01/11 - 17:06:36 | 200 |      71.387µs |       127.0.0.1 | GET      /service-worker.js
[GIN] 2019/01/11 - 17:06:36 | 200 |     349.347µs |       127.0.0.1 | GET      /application
[GIN] 2019/01/11 - 17:06:36 | 200 |     278.844µs |       127.0.0.1 | GET      /message?since=0
[GIN] 2019/01/11 - 17:06:36 | 200 |      80.306µs |       127.0.0.1 | GET      /static/defaultapp.png
[GIN] 2019/01/11 - 17:06:38 | 200 |     256.609µs |       127.0.0.1 | GET      /client
[GIN] 2019/01/11 - 17:06:41 | 403 |     555.275µs |       127.0.0.1 | GET      /stream?token=C8VbjR_YYYYYYYYY
[GIN] 2019/01/11 - 17:06:41 | 200 |     548.888µs |       127.0.0.1 | GET      /current/user

Support different sounds and priority

First of all, I'm really thankful someone finally created this self hosted solution :) Works great and seems pretty battery friendly, so I'm really happy with it as alternative for GCM.

Maybe you could extend it functionality a bit with being able to set different sounds per priority? I'd say priority 0 (or -1, don't know what the lowest is actually?) should never play any sound, that one shouldn't be to hard to implement I think? Next step (or maybe the same ;)) would be able to setup different sounds and colors per priority level.

And finally it would be really great if a sound field could be implemented on the server, which the client interprets. Just like pushover allows you to send different sounds, but I could imagine something simpler like settings sound1, sound2, sound3 etc in the client and just use that as value for the sound field.

Support self-signed SSL Certs

The Android client doesn't appear to support self-signed SSL certs, which is inconvenient if the server is for internal use. Would it be possible to add an option to ignore self-signed errors, or pull certificates from the user's certificate authority store during certificate validation?

Title font too large

If I set the font size to medium or large on my Xiaomi (MIUI) phone only the top part of the title text is displayed. The lower part gets overwritten by the message body

Less intrusive notification

IMO the current notification is way to intrusive for its purpose (to keep the app "online"), I know other apps make use of another type of smaller ("system"?) notification which is only shown when you pull down the notification drawer (and otherwise is hidden on lock screen etc.)

Would it be feasible to migrate to this?

No sound

Is there a way to set a custom sound?

PS: btw I've no sound notifications from app at all...

Markdown Inline-style images not rendering

gotify/android v2.0.6
gotify/server v2.0.4

Sending an Inline-style image using Markdown doesn't render the image on the android app but does correctly on the server app.

![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png)

Sending the above message results in only getting "alt text" on android.

Please add/allow markdown/links also in "Title"

Hello,
could you please add or allow to use links also in the Title. In Textarea it is not suitable.
Here my example:

Trainstation: Paris
Information Train 111 : Delay +100
Information Train 222 : On Time
Information Train 333 : Cancelled

Where to add the link to the train station Paris? ;-) - In the Tiltle

Many Thanks.

Listen to network changes

Currently, when changing to a different network (wifi-wifi oder wifi-cell), Gotify loses the connection and waits one minute.
Also when disabling internet entirely, the reconnection schedule is still running.

Show App Version in App

I'm surprised I can't find a version number inside the app. :-)
Please note this article regarding app connection/information: #60

Application killed on connection issue

Hi,

I notice that from time to time the application just get killed and I need to reopen it.
Today morning when this happened I can see the following in the logs (ordered from most recent):

WARN: Destroy WebSocketService
INFO: WebSocket: closing existing connection
INFO: WebSocket: Network not connected
ERROR: WebSocket: failure Message: java.net.SocketTimeoutException: failed to connect to *** after 10000ms
...

Is this an expected behaviour?
Can a retry be implemented instead to close the app?

Thanks and regards,

Forward notification to other apps

It would be nice if this app can be used as forwarder for notifications to use gotify instead of FCM for notification handling.

An alternative/intermediate solution might be that a tap on the notification opens my app

Cleartext communication not allowed on Android 9.0/Pie

Cleartext communication isn't allowed on Android Pie by default, so currently at least an SSL enabled Gotify server must be used.

Error message in adblog: Caused by: java.net.UnknownServiceException: CLEARTEXT communication to <IP> not permitted by network security policy

Tested by connecting to a default Gotify server.

Show complete login URL in (Side-) Menu

In the Moment you see in den top of Menu:

Gotify-Server 2.0.1
[email protected]

Port and/or subpath are not shown in the moment. Please show complete URL which was entered during Setup. An own menu point would be oversized.

user@https://mydomain.com:8080
user : http://mydomain.com/gotify
user
http://mydomain.com/gotify

Background: I had two gotify instances on same server with different ports for testing. It was not possible to determine on phone to which instance the phone connects to. For telefonsupport in the family it would also be helpful. ;-)

Unable to connect to server on local network with custom DNS server

I have a dnsmasq instance running to achieve some sort of "NAT loopback", so I can access my server (hosted in my home network) with its DDNS address. If I try to connect to my Gotify server using a web browser, it works. When I use the app, it doesn't. I have to switch to LTE/4G to be able to connect to it.

Log:

I think this might be a bug with Android itself, as other apps have this exact same issue - handshake succeeds but the following actions just fail.

Make already received messages available in Flightmode/No Network situation

When i want to read the already received messages/information in Flightmode or without Network Connection (Trains in Germany) i only get the information: "No connection to server".

Please make in this case the already received message readable and shown then an additional information that network connection is not existing.

Unrendered markdown shown in notifications

Hi,

First of all, thanks for the awesome software!

I've noticed when sending markdown messages that raw/unrendered markdown is displayed in the notification. This is particularly jarring when the first part of the message consists of a link or image.

I've attached a screenshot below to demonstrate:

Screenshot_20190608-181532

Is it possible to strip the markdown formatting and just display the textual content of the message in the notification.

My client/server versions are as follows:

Client: v2.0.7 (from F-Droid)
Server: v2.0.5 (Docker)

Thanks in advance.

Start on boot

An option to start the service on device boot would be neat :)

Allow links in message body to be clickable

Related: #21

Currently I think the only way to open links in the message is to type the URL in the browser manually. It would be good to add an android:autoLink="web" attribute to the message layout xml so that URLs in message body could be clickable.

Markdown is entirely re-rendered as you're scrolling up and down, resulting in images redownloading

Issue: After pushing a few Markdown-formatted messages with images in them, older messages are pushed downwards. After a message is out of the view bounds, it seems to be "forgotten" about: scrolling back to a message you previously viewed re-renders the message and downloads the image all over again.

Suggestion: Cache images in notifications on the device. As soon as a notification is deleted, any accompanying images for that notification are removed from the cache.

gotify app gets killed

I'm running 2.0.6 on my android phone and for some reason gotify dies at some point and does not restart. This does not happen to e.g. Whatsapp nor Facebook.

Anything I should configure or can I provide more information to figure out what is happening?

Best regards
Daniel

NPE (from google play console)

java.lang.RuntimeException: 
  at android.os.AsyncTask$3.done (AsyncTask.java:355)
  at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:383)
  at java.util.concurrent.FutureTask.setException (FutureTask.java:252)
  at java.util.concurrent.FutureTask.run (FutureTask.java:271)
  at android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:246)
  at java.util.concurrent.ThreadPoolExecutor.processTask (ThreadPoolExecutor.java:1187)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:784)
Caused by: java.lang.NullPointerException: 
  at com.github.gotify.messages.provider.MessageStateHolder.newMessages (MessageStateHolder.java:19)
  at com.github.gotify.messages.provider.MessageFacade.loadMore (MessageFacade.java:35)
  at com.github.gotify.messages.provider.MessageFacade.loadMoreIfNotPresent (MessageFacade.java:43)
  at com.github.gotify.messages.MessagesActivity$SelectApplicationAndUpdateMessages.doInBackground (MessagesActivity.java:374)
  at com.github.gotify.messages.MessagesActivity$SelectApplicationAndUpdateMessages.doInBackground (MessagesActivity.java:363)
  at android.os.AsyncTask$2.call (AsyncTask.java:334)
  at java.util.concurrent.FutureTask.run (FutureTask.java:266)

App does not notify (no sound/no point) after about 1 week.

Hello,

our smartphones (Moto 5 Android 8.1) normally work 24h a day without reboot.
After about 1 week (without touching the app?) the gotify app does not notify for new messages. (No sound/No Point)
At this point you can send as many messages, but not notified by app.
If you open the app, you see all the messages.
BUT also the next message is not notified.
This means: After a while the app loses the ability to notify about new messages no matter if you open the app or not.

You can only solve the problem if you stop the app manually in settings and start it again.
From this point all new messages are notified with sound and point.

This happens on both phones. Has anybody an idea what the problem is?
Could someone verify this?

Thanks.

pm-pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.