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

iOS app #4

Closed
binwiederhier opened this issue Nov 18, 2021 · 74 comments
Closed

iOS app #4

binwiederhier opened this issue Nov 18, 2021 · 74 comments
Labels
enhancement New feature or request in-progress 🏃 I'm working on this right now ios ntfy iOS app

Comments

@binwiederhier
Copy link
Owner

binwiederhier commented Nov 18, 2021

If you're interested in making an iOS app, I'm more than happy to help out. Unfortunately I don't have an iPhone or a Mac so it's a little tricky for me.

Significant work has been done here (https://github.com/Copephobia/ntfy-ios), but it's stale now, sadly.

I have picked up the work in https://github.com/binwiederhier/ntfy-ios and will hopefully be able to release soon.

@binwiederhier binwiederhier added the enhancement New feature or request label Nov 18, 2021
@binwiederhier binwiederhier changed the title iOS app Please help making an iOS app for ntfy.sh Nov 18, 2021
@binwiederhier binwiederhier added in-progress 🏃 I'm working on this right now and removed help-wanted labels Nov 29, 2021
@Copephobia
Copy link
Contributor

I am working on the iOS app for ntfy, in case github cannot assign the issue to me.

@Copephobia Copephobia self-assigned this Nov 29, 2021
@binwiederhier
Copy link
Owner Author

Hey @Copephobia, can you give an update of how it's going? Need any help?

@gedw99
Copy link

gedw99 commented Dec 29, 2021

Hey you can build cross platform golang apps using gio

It has notifications plugin here:
https://github.com/gioui/gio-x/tree/main/notify

i use it . It is easy no works . Not web notification yet but quite easy with gio - just look at other plugins to see how .

gio is all golang and compiles for web , all desktops, all mobiles.

just wanted to highlight this as an option .

If you search for “gioui” you will find many apps built with it .

I use it . It’s really high quality

@binwiederhier binwiederhier removed the in-progress 🏃 I'm working on this right now label Jan 16, 2022
@binwiederhier
Copy link
Owner Author

Sadly I haven't heard from @Copephobia in weeks, so I don't think it'll happen :-(

I'm gonna go looking for an iOS dev.

@gedw99
Copy link

gedw99 commented Jan 16, 2022

I read on the Unified Push web site that the IOS app needs to support Background worker , but i don’t think it’s possible . AppNap on iOS puts applications into sleep mode .

gio android does support foreground and background btw .

gio iOS only supports foreground and so the IOS AppNap never occurs.

@binwiederhier
Copy link
Owner Author

For the iOS app I'd love at least basic messages with firebase for ntfy.sh. i think that should be possible hopefully. Whether or not and to what extent other features are supported we'll have to see. But for now I can't even find anyone to do the iOS basic app.

@gedw99
Copy link

gedw99 commented Jan 17, 2022

well you could do it with golang, but GIo does not have a IOS driver yet. It does have a driver for web, desktop ( win, mac, linux ) and mobile (android). I think that it could be done in a few days.

https://github.com/gioui/gio-x/tree/main/notify

Looking for devs using it: https://github.com/search?o=desc&p=2&q=gioui.org%2Fx%2Fnotify&s=indexed&type=Code

found one decent example: https://github.com/arborchat/sprig/blob/main/core/notification-service.go

@Copephobia
Copy link
Contributor

Current work towards iOS, feel free to follow along: https://github.com/Copephobia/ntfy-ios

(Relevant macOS development branch: https://github.com/Copephobia/ntfy/tree/macos-development)

@binwiederhier
Copy link
Owner Author

For transparency, here's the contents of the Discord #ios channel. That room is now bridged to Matrix as well: https://matrix.to/#/#ntfy-ios:matrix.org

220207 14-50-09 Selection 001

220207 14-50-20 Selection 001

220207 14-50-31 Selection 001

220207 14-50-42 Selection 001

220207 14-50-53 Selection 001

@binwiederhier binwiederhier changed the title Please help making an iOS app for ntfy.sh iOS app Mar 13, 2022
@binwiederhier binwiederhier added the in-progress 🏃 I'm working on this right now label Mar 13, 2022
@binwiederhier
Copy link
Owner Author

binwiederhier commented Apr 12, 2022

📢 Update: Sadly work has been stale for over a month now, and I'm not sure when/if it'll be picked up again. If anyone else is interested in continuing the work, please feel free to do so. Maybe I'll buy a Mac at some point.

@binwiederhier binwiederhier removed the in-progress 🏃 I'm working on this right now label Apr 12, 2022
@easrng
Copy link

easrng commented Apr 22, 2022

Here's an iOS Shortcut that checks for new ntfy notifications and shows them. Unfortunately you can't have a Shortcut run on a fixed interval, only on manually added times (ex. you can set a Shortcut to run every day at 2pm, but not every 5 minutes) so if you want it to check automatically you're going to be adding a LOT of automations. It supports titles, messages, and turns off sound for low-priority notifications.

@lylebrown
Copy link

Here's an iOS Shortcut that checks for new ntfy notifications and shows them. Unfortunately you can't have a Shortcut run on a fixed interval, only on manually added times (ex. you can set a Shortcut to run every day at 2pm, but not every 5 minutes) so if you want it to check automatically you're going to be adding a LOT of automations. It supports titles, messages, and turns off sound for low-priority notifications.

I would love to be proven incorrect, but doesn't iOS require the device to be unlocked (as in, the screen turned on and not on the lock screen) for shortcuts to run?

@g-a-c
Copy link

g-a-c commented May 5, 2022

Here's an iOS Shortcut that checks for new ntfy notifications and shows them. Unfortunately you can't have a Shortcut run on a fixed interval, only on manually added times (ex. you can set a Shortcut to run every day at 2pm, but not every 5 minutes) so if you want it to check automatically you're going to be adding a LOT of automations. It supports titles, messages, and turns off sound for low-priority notifications.

I would love to be proven incorrect, but doesn't iOS require the device to be unlocked (as in, the screen turned on and not on the lock screen) for shortcuts to run?

I don't think this is true - I have a Shortcut that opens Spotify when my phone connects to my in-car entertainment via Bluetooth, and this will usually fire with my phone in my pocket. I say "usually" because sometimes Spotify doesn't actually open, but even when Spotify isn't opened I still get the notification that the Shortcut was executed.

@Seji64
Copy link

Seji64 commented May 5, 2022

Hello,
happened to come across this issue as I would like to use ntfy on iOS.

So I took a look at the iOS code (https://github.com/Copephobia/ntfy-ios). As I see it, the app is practically ready. I think the problem why the development was stopped is that Copephobia probably didn't find a good solution for the notifications. I thought about the problem and wondered how Mastadon solved it.

Because here each instance is self-hosted and yet the notification works via a central official app. I came across the various proxy's / relay's (such as https://github.com/DagAgren/toot-relay). I think this could solve the whole thing quite elegantl. Sorry if I now come here with an 'idea' that was already known to all of you - did not want to be the wise guy - just give a hint or help.

A good explanation how this all works i found here

is ntfy already capable to send such notification to a push relay?

@cmeis
Copy link
Contributor

cmeis commented May 23, 2022

Tested on an iPad Mini 4 with OS version 15.4.1.

I'd say it basically works quite good already.

What works:

  • notifications are received correctly with app in foreground
  • notifications are received correctly with app in background
  • hard killing the app doesn't do any harm too, notifications still are coming in
  • notification sent while iPad was offline (WiFi disabled on a WiFi only model) are received as soon as WiFi is connected again

What didn't work 100%:

  • a notification sent while the iPad was powered off was on one occasion only received after opening the app, i.e. not after powering on and unlocking the device (I did wait for about a minute before manually opening the app)

What didn't work:

  • clicking on a notification bubble does only take you to the app "where is was" (even in a different topic), not to the correct topic. This works on Android.

@binwiederhier
Copy link
Owner Author

binwiederhier commented May 23, 2022

Thank you @cmeis for the detailed feedback. I'm gonna all this a win overall.

a notification sent while the iPad was powered off was on one occasion only received after opening the app, i.e. not after powering on and unlocking the device (I did wait for about a minute before manually opening the app)

That's a Firebase thing. Nothing I can do about I think. Firebase is icky on Android too sometimes. Thank you for reporting it.

clicking on a notification bubble does only take you to the app "where is was" (even in a different topic), not to the correct topic. This works on Android.

That's not implemented yet, so it's expected :-)


No messages are received in foreground and background. If I manually refresh (pulling down inside the app) I do receive the messages, however.

@fosspill You have been so far the only person who mentioned that no messages were received at all.

  1. May I ask you if you clicked "Allow notifications" in the dialog that pops up when the app launches for the first time?
  2. Also, do you mind re-installing and seeing if that does anything.
  3. Is this a JB device, or otherwise modified? The app does need Firebase/Google to deliver messages.

@fosspill
Copy link

@binwiederhier

  1. I'm unsure about exactly when I enabled notifications, but notifications were indeed enabled for ntfy during my testing. I confirmed this through settings multiple times
  2. Re-installing worked, but I reinstalled on a different network in case something firebase-related was blocked during installation.
    After reinstalling it also works fine on the network I originally installed the app on.

So... I'm not entirely sure about what happened here but the issue is resolved 🤷

@binwiederhier
Copy link
Owner Author

@fosspill Thank you for retesting. That makes me feel much better. You were the first feedback and it was "nothing works", that was quite the bummer. Glad it works now. Maybe I can somehow get an indication in the UI to show if Firebase works or not.

@fosspill
Copy link

@binwiederhier Hah, I can imagine that. It did feel pretty bad to leave that feedback right away as well, but I'm super happy that it works now. I'll finally be able to use ntfy in my workflow and that's all thanks to your hard work.
Some firebase indication would have been interesting, and I would have liked to figure out what went wrong. But, if a reinstall is all that's needed then it's not really a big issue. Maybe we can blame cosmic rays for now.

@binwiederhier
Copy link
Owner Author

Dont feel bad. This is exactly the feedback that I need. Only a handful from the people who try it leave any feedback. So this is good stuff. It's a really really rough version, but I want to release quickly and then iterate towards features and stability.

@skr32
Copy link

skr32 commented May 23, 2022

Here me feedback:

  • Subscribe to different Topics
  • Receive Notification on those topics. Push notification works on unlocked and locked screen and while app is in background or closed
  • Unsubscribing works. No notification for removed topics.
  • Content: Title & Messages work for me

Seems like everything works as it should!

Thank you for the App!! Cant wait for Content & Tags to work ;)

@binwiederhier
Copy link
Owner Author

Thank you for your feedback!

@binwiederhier
Copy link
Owner Author

binwiederhier commented May 23, 2022

I'd like to thank everyone for the feedback. Keep it coming!! It helped a lot to assess the state of the app. I have decided to submit the app for review as-is by tomorrow night (Tuesday, May 24). I know there are lots of issues, but I'd rather the Apple community have something than nothing.

Issues I am aware of:

Feature requests:


👉 I am still updating #4 (comment) with more feedback as it comes in.

@skrollme
Copy link

skrollme commented May 24, 2022

I'm new to ntfy because I was looking for an (possibly self-hosted) alternative to ifttt.com push messages. As I saw the development/progress of the iOS I subscribed to this topic and tried the TestFlight build as it came out:
👍 Works like charm and I'm already waiting for more features to come.
In the meantime I will switch my toolchains to use ntfy

P.S.: Any official channels to donate / support the project? Paypal? Github sponsor?

@SxthGear
Copy link

A little late to the party as it looks like you're pushing live today sometime, but I just happened to see this posted on /r/selfhosted and have been waiting for iOS support for some time now. Prelim run through of different things on an iPhone 13 Pro, iOS 15.4.1:

👍 Works perfectly, even with some odd ASCII characters and emoji thrown at it. Can't wait to run a selfhosted version!

@binwiederhier
Copy link
Owner Author

Love hearing that. Thanks folks. 👍

@binwiederhier
Copy link
Owner Author

binwiederhier commented May 25, 2022

Rejected... For mentioning Android... I suppose that's an easy enough fix.

"We found the metadata of your submitted in-app purchases includes irrelevant third-party platform information. Specifically, Android references is mentioned in the description.

Referencing third-party platforms in your app or its metadata is not permitted on the App Store."


Edit: This was my mistake. The description was just copied from the Android app and mentioned that this is the Android app not the iOS app. Oops. Well let's try it again.

@binwiederhier
Copy link
Owner Author

binwiederhier commented May 25, 2022

🥳 It's happening

https://apps.apple.com/us/app/ntfy/id1625396347

--
Note that in a day or two I'll release the update with all the things mentioned here #4 (comment)

@binwiederhier
Copy link
Owner Author

I'm going to keep this ticket open for a while to communicate updates on iOS, but eventually I'll close it. To stay in the iOS loop, I highly recommend joining the Discord or Matrix (links on main GIthub page).

Updates:

  • Aside from attachments, I've implemented pretty much all "publish" features (priority, tags/emojis, click target, user action buttons). There is no configuration/muting/... and such as there is in Android yet, obviously.
  • As for selfhosted servers, I have not started that work yet officially, BUUTT, I think I may be able to do a "selfhosted light" variant pretty quickly: Basically poll all topics every 20-60min or so (Apple is vague on this, it's also not guaranteed to run at all) by remotely triggering silent "poll now" Firebase messages. The messages are empty, they just serve as triggers to poll all topics. I've got this implemented in https://github.com/binwiederhier/ntfy-ios/pull/5/files and it works nicely. I think I can get that into the next release too, though likely without support for auth.

Here are a bunch of pictures: https://photos.app.goo.gl/KeERoCa25WqnfpuC8

@binwiederhier
Copy link
Owner Author

Here's a short video showing my progress on the selfhosted server support: https://photos.app.goo.gl/weSQxdbL8kkt11nS8

Here's what's happening:

  • Top screen: User sends a message to "middle screen" (= selfhosted server)
  • Middle screen: Selfhosted server is configured to send a message to topicHash=sha256($topic) containing the message ID of the original message (poll_id=$messageID) to an upstream server (= ntfy.sh). This is equivalent to curl -X POST -H "Poll: $messageID" ntfy.sh/$topicHash).
  • Bottom screen: Upstream server (ntfy.sh) receives the poll request and forwards it to Firebase topic $topicHash (which forwards it to APNS). The poll request contains only the original message ID; none of the other fields of the original message. It looks like this: {"id":"Xi6uHAal8f7i","time":1653619618,"event":"poll_request","topic":"mylongtopichash","message":"New message","poll_id":"123"}
  • Phone: receives the poll request from APNS, containing $messageID, and asks the selfhosted server for the original message (equivalent to curl "localhost:2587/test/json?poll=1&id=Ab9dXUgm83cp)
  • Phone displays message.

--> Firebase/APNS are used as signalling mechanism, and the actual message is fetched by the phone.

image

@prabirshrestha
Copy link

You might be able to use location service feature of iOS to have frequent polling. At least that is what Dropbox and other products do. https://help.dropbox.com/installs-integrations/mobile/location-data

Other option I could see is adding shortcut to force poll so I can run it when it charges or connects to Wi-Fi and so on. Shortcuts does have show notification action.

Some more additional options here. https://stackoverflow.com/questions/35388086/is-there-a-way-to-wakeup-suspended-app-in-ios-without-user-or-server-interventio

found a bug:
If your topic is long it seems to flicker as it adjusts the size in header.

@Famku
Copy link

Famku commented May 29, 2022

Hi.

I just tested NTFY App 1.1 and it works very good with self hosted ntfy.

Thank you for your hard work!

@binwiederhier
Copy link
Owner Author

Whoa. I didn't even know it was live yet. Apple hasn't sent me an email yet that it's live. I would've posted instructions here too. I'll do that later. Right now I'm in IKEA bed building mode.

@binwiederhier
Copy link
Owner Author

binwiederhier commented May 29, 2022

📢 🥳 Request for testing

This release of the iOS app adds message priorities (mapped to iOS interruption levels), tags and emojis, action buttons to open websites or perform HTTP requests (in the notification and the detail view), a custom click action when the notification is tapped, and various other fixes.

It also adds support for self-hosted servers (albeit not supporting auth yet). The selfhosted server needs to be configured to forward poll requests to upstream ntfy.sh for push notifications to work (see https://ntfy.sh/docs/config/#ios-instant-notifications for details).

PLEASE TEST all of the above features. Report issues ON GITHUB or IN TESTFLIGHT.

How to test

➡️ https://testflight.apple.com/join/P1fFnAm9 ⬅️

Notes

After this release, I will close this issue and I'll be moving towards a business as usual method for iOS releases. I'll still try to catch up with most Android features, but I won't be asking for TestFlight here. Instead, I'll ask in Discord/Matrix, and/or in https://ntfy.sh/announcements.

I added a bunch of tickets for future iOS work ( ios ntfy iOS app ), please 👍 the one you'd like the most, so I know what to prioritize. Otherwise I'll just do them in whatever order I think makes sense or is the most fun.

@binwiederhier binwiederhier unpinned this issue May 29, 2022
@binwiederhier
Copy link
Owner Author

Any positive/negative feedback on the new iOS version?

@mikniche
Copy link

mikniche commented May 30, 2022

I've got it working nicely with my self hosted instance of ntfy, after following the instructions and adding the upstream url 🙌

Almost instant push notifications 🎯

@robfox92
Copy link

Works well - the only thing that tripped me up was the need to specify the server is using https in the app. I'd initially specified "ntfy.<my_selfhosted_instance>.xyz" instead of "https://ntfy.<my_selfhosted_instance>.xyz".

Maybe it's worth prepending the server address with https:// automatically?

@binwiederhier
Copy link
Owner Author

Awesome to hear that it's working. Thanks for the feedback. Keep them coming

Maybe it's worth prepending the server address with https:// automatically?

👍 The Android app has validation and a placeholder for this. I'll add something like that.

@prabirshrestha
Copy link

Tried the selfhosted server and it works great.

iOS Bug:

  • Double line to single line for long topics seems to be fixed but now the font sizes changes.

Web Bug:

  • If WebSockets is not enabled on the proxy server or fails to connect, it doesn't any error message. I had to open the console and see that there was a websocket error and had to enable WebSocket on the proxy server that comes with synology nas.

iOS feature requests:

  • My domain is not small as notify.sh. Remember my last used settings for "Use another server" and the "Server URL" or even better if the "Server URL" is a list of predefined servers where user can add or remove.

ntfy feature requests:

  • add support for LDAP auth so it plays nicely with rest of the self hosted ecosystem. You can try it with gldap server. I would like to avoid mantaining yet another user/password combination. This is easier for family members that are non-tech.
  • add support for tokens. I would like to use different token with custom expiration.
  • add support for making a topic as listed or unlisted similar to youtube https://support.google.com/youtube/answer/3127309?hl=en. This will allow a family member to register a server and then easily discover listed topics.

docs request:

  • What happens if upstream-base-url is set but fails to send to the upstream server. This could be due to temporary internet connection getting down. Will this be retried or will be lost.
  • This is a bit confusing.

The ntfy.sh server publishes the message to Firebase, which forwards it to APNS, which forwards it to your iOS device
Your iOS device receives the poll request, and fetches the actual message from your server, and then displays it

The ntfy.sh server publishes the message to Firebase. What is a message here? Is it just the poll id and topic hash?

@binwiederhier
Copy link
Owner Author

Thank you for the detailed feedback. I love it ❤️ Would you mind reporting bugs and feature requests in individual tickets? It's impossible for me to keep track of things if they are in comments. Thanks.

I'll respond to your comments in detail tomorrow.

@prabirshrestha
Copy link

Created separate feature requests. Hope it is not a lot 😃 .

Here are the top ones for me to replace pushover with ntfy. I probably only need 1 and 2 to start testing E2E in my real home servers.

  1. iOS: Support auth #277
  2. Clarify docs.
  3. Add tokens support
  4. LDAP auth

(By the way thanks for the awesome progress in the past few days. Really excited to see ntfy working on iOS.)

@binwiederhier
Copy link
Owner Author

Closing this ticket 🥳

With the release of the iOS v1.1 app 🥳, I am ceremonially closing this ticket. 🥳 🥳 🥳

You may of course continue to leave feedback here, or create tickets in the main GitHub.

Discord/Matrix + ntfy.sh/announcements

I also encourage you to join Discord or Matrix, and subscribe to the https://ntfy.sh/announcements topic. I'll potentially be asking for TestFlight testers there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in-progress 🏃 I'm working on this right now ios ntfy iOS app
Projects
None yet
Development

No branches or pull requests