[GH-ISSUE #197] Prettify non-standard JSON in android app #154

Closed
opened 2026-05-07 00:20:42 +02:00 by BreizhHardware · 5 comments

Originally created by @kzshantonu on GitHub (Apr 3, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/197

Certain apps eg: Uptime Kuma POST a lot of information as JSON. Would be nice if the android app displayed these as somewhat human readable format eg: as a table

Originally created by @kzshantonu on GitHub (Apr 3, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/197 Certain apps eg: Uptime Kuma POST a lot of information as JSON. Would be nice if the android app displayed these as somewhat human readable format eg: as a table
Author
Owner

@binwiederhier commented on GitHub (Apr 3, 2022):

Can you give a concrete example? Is this the same as #104 again, or is this about the presentation of the data?

ntfy should not be changing your message at all; that seems wildly out of scope. ntfy should also not know what you are sending, so if it's JSON from Uptime Kuma or a random other message doesn't matter to ntfy.

It may be useful to have Markdown support for basic formatting, but typically I want to avoid that, because the overall app appearance suffers from it.

<!-- gh-comment-id:1086942571 --> @binwiederhier commented on GitHub (Apr 3, 2022): Can you give a concrete example? Is this the same as #104 again, or is this about the presentation of the data? ntfy should not be changing your message at all; that seems wildly out of scope. ntfy should also not know what you are sending, so if it's JSON from Uptime Kuma or a random other message doesn't matter to ntfy. It may be useful to have Markdown support for basic formatting, but typically I want to avoid that, because the overall app appearance suffers from it.
Author
Owner

@kzshantonu commented on GitHub (Apr 5, 2022):

A bit different from #104. Mine was purely about cosmetics. Instead of displaying the json as a text blob (unformatted), it could prettify it. Currently, Kuma notifications are displayed like this in the app:
Screenshot_20220405-061838.jpg

The app when it detects JSON, could for example, add some colors and format it in a human readable form

<!-- gh-comment-id:1088252566 --> @kzshantonu commented on GitHub (Apr 5, 2022): A bit different from #104. Mine was purely about cosmetics. Instead of displaying the json as a text blob (unformatted), it could prettify it. Currently, Kuma notifications are displayed like this in the app: ![Screenshot_20220405-061838.jpg](https://user-images.githubusercontent.com/7745374/161678021-c4d61d33-c0ba-4429-ae26-c5d733608248.jpg) The app when it detects JSON, could for example, add some colors and format it in a human readable form
Author
Owner

@binwiederhier commented on GitHub (Apr 5, 2022):

While I understand your rationale behind this, I think this is very much outside the scope of what ntfy should do. If you want your message to look different, you should send another message. What you're describing sounds like an email program modifying emails at will, which is unexpected and would feel intrusive.

Plus, messages are by default broadcast as Android intent, meaning that other apps can read and process them. I shouldn't modify the payload at all for that reason too.
.o hope that makes sense.

<!-- gh-comment-id:1088598116 --> @binwiederhier commented on GitHub (Apr 5, 2022): While I understand your rationale behind this, I think this is very much outside the scope of what ntfy should do. If you want your message to look different, you should send another message. What you're describing sounds like an email program modifying emails at will, which is unexpected and would feel intrusive. Plus, messages are by default broadcast as Android intent, meaning that other apps can read and process them. I shouldn't modify the payload at all for that reason too. .o hope that makes sense.
Author
Owner

@kzshantonu commented on GitHub (Apr 5, 2022):

Good point. Maybe the notification and/or intent can still stay original but the json can be parsed and displayed inside the app in a prettified way, like in a code editor for example, like this:
Screenshot_20220405-142408__01.jpg
The data itself doesn't change at all. It's all just aesthetics. There could be a small button to view the raw message. Or the raw message could be the default and the small button is to prettify json

<!-- gh-comment-id:1088646494 --> @kzshantonu commented on GitHub (Apr 5, 2022): Good point. Maybe the notification and/or intent can still stay original but the json can be parsed and displayed inside the app in a prettified way, like in a code editor for example, like this: ![Screenshot_20220405-142408__01.jpg](https://user-images.githubusercontent.com/7745374/161753574-5add73e1-c2e3-4cf5-9937-86dc578b5835.jpg) The data itself doesn't change at all. It's all just aesthetics. There could be a small button to view the raw message. Or the raw message could be the default and the small button is to prettify json
Author
Owner

@binwiederhier commented on GitHub (Apr 12, 2022):

I really don't think that ntfy should do this. If it was easy I'd maybe do it, but it's a ton of work and probably some libraries for what seems to be a pretty odd edge case.

I'm taking the liberty of rejecting this proposal. Please do not take this personally, and do not be discouraged to submit more ideas. I love seeing how people are using ntfy and it makes me happy that you guys wanna add features. But please do understand that I can't implement every idea.

Thank you.

<!-- gh-comment-id:1095747549 --> @binwiederhier commented on GitHub (Apr 12, 2022): I really don't think that ntfy should do this. If it was easy I'd maybe do it, but it's a ton of work and probably some libraries for what seems to be a pretty odd edge case. I'm taking the liberty of rejecting this proposal. Please do not take this personally, and do not be discouraged to submit more ideas. I love seeing how people are using ntfy and it makes me happy that you guys wanna add features. But please do understand that I can't implement every idea. Thank you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#154
No description provided.