server icon indicating copy to clipboard operation
server copied to clipboard

iOS-App

Open jmattheis opened this issue 8 years ago • 20 comments

It would be great to have an iOS app for Gotify. Maybe someone from the community could contribute such an app as I do not have any experience with iOS/swift.


There is a third-party app; not affiliated with this project:

  • https://github.com/androidseb25/iGotify-Notification-Assistent
  • https://apps.apple.com/de/app/igotify/id6473452512

jmattheis avatar Nov 26 '18 20:11 jmattheis

I'm afraid the biggest obstacle would be Apple's strict restrictions on background services. We cannot keep a persistent WebSocket connection in the background without abusing some APIs, which will absolutely disqualify the app from going onto the App Store and drain the battery significantly. Notifications could only be delivered through APN, which requires a developer account and a central server to manage notifications and send them to Apple before reaching the user, but this is not what gotify is designed for.

eternal-flame-AD avatar Jan 25 '19 04:01 eternal-flame-AD

Thanks for your insight @eternal-flame-AD. It sucks that iOS has such strict restrictions.

I'm closing this issue for now because gotify will not use any third party service to deliver messages.

jmattheis avatar Jan 25 '19 19:01 jmattheis

@jmattheis Do you think it would be a viable option to at least have a client which displays and receives old and new push notifications while in the foreground, without the functionality of actually getting push messages over Apple's push notification service? I know this would -at least partly- subvert the reason and meaning behind such a push service and, especially, a corresponding notification app, but it would at least make a live-view mode available, and you could use it to manually check for new notifications.

My current assumption is that for instance PushOver and Catapush use APNs to at least notify that there is new data, which then again is probably triggering a "pull" of the actual data from their respective services/endpoints. But this unfortunately requires using the APNs. Maybe it'd be an option to make something like that available as an optional plugin/extension, which connects to the APNs and takes over the part of notifying for new data?

Nevertheless, I'm going to make some research on this topic in the next few days, and see if I find any possibility with which this could be worked around. I'm going to look into the exact restriction of background jobs on iOS. It seems that the German Corona Warn App is using a mechanism to display messages from the background without push notifications. Maybe there's at least a possibility to run something like a REST request periodically, to check whether there are new messages or not. (Maybe that's inexpensive enough from a power consumption perspective.) If that would be feasible, we would at least have the option to display something like "There are X new notifications. Open the Gotify App to check 'em out."

je-s avatar Feb 03 '21 02:02 je-s

Sure, an app with limited functionality is better that no app at all (:

Pushover encrypts messages with a device key, thus, transmitting the whole message via APN/FCM -> https://support.pushover.net/i46-are-messages-notifications-encrypted

Yeah, probably iOS has some kind of periodic job, in which new messages could be fetched.

jmattheis avatar Feb 04 '21 07:02 jmattheis

By using the Push Notification Extensions the one may send encrypted messages to the device endpoint and the device would be possible to decrypt it using the extension. However, quoting "I'm closing this issue for now because gotify will not use any third party service to deliver messages." I doubt that this would be a place for the gotify team to go though...

GalvinGao avatar Feb 06 '21 16:02 GalvinGao

Not re-opening this issue, but I think this is relevant to share here.

Just switched back over to iOS from Android and was bummed to find there is no Gotify iOS app. So I wrote a little shell script that watches the Gotify stream and then sends me notifications through Pushover using ntfy.

Here's the relevant snippet:

#!/usr/bin/env bash

token='xxxxxxxxxxxx'
uri='ws://192.168.1.10:8000/stream'

while read line
do
        ntfy send $(echo ${line} | jq -r '.message')
done < <(websocat -H "X-Gotify-Key: ${token}" -t - autoreconnect:"${uri}")

This snippet will read each newline that websocat receives and send it to me via ntfy. You can replace ntfy send with whatever command you want to use that sends you notifications.

This setup is nice because I don't need to switch everything to Pushover, I can keep Gotify for all my notifications.

EDIT: I updated the script with the autoreconnect overlay so it can handle Gotify going down and coming back up.

heywoodlh avatar Oct 29 '21 16:10 heywoodlh

Just switched back over to iOS from Android and was bummed to find there is no Gotify Android app.

not sure what you mean: https://github.com/gotify/android https://play.google.com/store/apps/details?id=com.github.gotify

najtin avatar Oct 29 '21 19:10 najtin

Ahhh forgive me. You meant that there is no Gotify iOS App. got it. sorry.

najtin avatar Oct 29 '21 19:10 najtin

Whoops, yeah, sorry for the typo @najtin! Fixed it.

heywoodlh avatar Nov 01 '21 21:11 heywoodlh

I'm closing this issue for now because gotify will not use any third party service to deliver messages.

But couldn't an iPhone app with periodic checking connect to the self-hosted server once in a while to get new messages? And when the user opens the app? See the background fetch details here.

A delayed message is better than nothing.

ghost avatar Mar 30 '22 11:03 ghost

But couldn't an iPhone app with periodic checking connect to the self-hosted server once in a while to get new messages? And when the user opens the app?

When the user opens the app, sure. But for background notifications, the developer has to specify the server, and that server has to send via Apple's notification servers. There's no way to make an app that allows the user to choose a server that sends background notifications.

strider72 avatar May 03 '22 20:05 strider72

Yes I understand. My point was that an app without background notifications could still be useful.

ghost avatar May 04 '22 11:05 ghost

what is the problem with APN? Maybe one could build an adapter that receives gotify notifications to GCM and APN for reliablea nd energy efficient notifications on IOS and Android? I don't know if using APN costs any extra money, but for GCM it does not AFAIk

EDIT: Found this alternative which works on ios and android: https://ntfy.sh/ haven't tried it yet though EDIT2: Works fine on Android, will test iOS later

wireva avatar Aug 16 '22 08:08 wireva

ntfy is perfect and self hosted. IOS work verry well.

mabed-fr avatar Sep 09 '22 17:09 mabed-fr

Just FYI for those getting thread notifications, I updated my script in my comment to autoreconnect when Gotify goes down and comes back up: https://github.com/gotify/server/issues/87#issuecomment-954891816

heywoodlh avatar Jan 05 '23 19:01 heywoodlh

Thank you for this app. That would actually work with the Android devices. however, we all use iPhones and it would be a great achievement if this app ran on iOS as well. Therefore I would offer you my Apple developer account and one of my professional industry servers for free use. My IBM servers are in southwest Germany and are connected to a secure network. Please let's test this and let me know... Many greetings from Germany...

Maxiggapp avatar Feb 08 '23 12:02 Maxiggapp

Take a look at the iGotify-Notification-Assistent

nallej avatar Jan 10 '24 11:01 nallej

Have you heard about this? https://developer.apple.com/videos/play/wwdc2020/10113/ https://developer.apple.com/documentation/networkextension/local_push_connectivity

BetterB0y avatar Apr 23 '24 12:04 BetterB0y

There is a iOS App. iGotify on the ios app store by this awesome Dev >Sebastian Rank

https://apps.apple.com/us/app/igotify/id647345512

MxD-js avatar May 10 '24 21:05 MxD-js

Omg this is a bummer.

cbrunnkvist avatar Dec 21 '25 17:12 cbrunnkvist