mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #1196] When subscribing to messages via an API using the raw stream, how should the messages be split in order to retrieve the latest ones? #845
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#845
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BaeKey on GitHub (Oct 9, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1196
After reviewing the documentation, I couldn't find any query parameters that allow fetching the latest messages. I want to use iOS Shortcuts to retrieve the latest messages for a specified topic. However, using either /json or /sse, iOS Shortcuts currently can't parse the file content correctly. If I use the raw format, I'm unable to properly split the content. I have also found a similar issue to mine.
How to get the latest message of a topic in JSON format from the API?
Could you consider adding a filter parameter to retrieve the latest message, or advise me on how to correctly parse the messages from the raw format?
@wunter8 commented on GitHub (Oct 10, 2024):
Here are the actions that worked for me. This will show a pop-up/alert/notification with the
messageof the most recent message sent to the topic@BaeKey commented on GitHub (Oct 10, 2024):
Thank you for your explanation. However, when using the method of splitting 'Contents of URL' by 'New Lines,' sometimes when dealing with multi-line text, I encounter an issue where only the last line of the text is extracted, and I haven't been able to solve it.
@wunter8 commented on GitHub (Oct 10, 2024):
When I send multi-line text and read it back in the "raw" stream, it's collapsed onto one line, so it splits fine in the iOS Shortcut. Are you saying it doesn't collapse onto one line for you?
@BaeKey commented on GitHub (Oct 10, 2024):
This issue might be related to my code. When I use a Python script to automatically send clipboard content, I use the following code:
During testing, when sending multi-line text, the iOS Shortcut only receives the last line of text.
Thank you for your help. Perhaps I can fix this by modifying the request I’m sending.
@wunter8 commented on GitHub (Oct 11, 2024):
Hmm. I tested your script (using python 3.10). The message printed on two lines in the console and in the web app, but in the "raw" stream, it was collapsed onto one line for me. I was able to grab the whole "test message" in the iOS Shortcut.
This printed on two lines in the console and in the web app
@BaeKey commented on GitHub (Oct 11, 2024):
I copied this paragraph at random:
When I send this, iOS Shortcut can only receive the last sentence.
@wunter8 commented on GitHub (Jun 9, 2025):
@BaeKey ntfy version 2.12.0 includes a new
?since=latestquery param that you can use to poll just the most recent message in any topic@BaeKey commented on GitHub (Jun 10, 2025):
Okay, I will try it. Thank you very much.