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

provide a unifiedpush endpoint for notifications #230

Open
butonic opened this issue Feb 21, 2025 · 1 comment
Open

provide a unifiedpush endpoint for notifications #230

butonic opened this issue Feb 21, 2025 · 1 comment

Comments

@butonic
Copy link
Contributor

butonic commented Feb 21, 2025

We currently serve our sse events at https://cloud.opencloud.test/ocs/v2.php/apps/notifications/api/v1/notifications/sse

Since we want to sunset ocs we can maybe move to a more standardized endpoint / payload. I propose https://unifiedpush.org/

ntfy (which adheres to unifiedpush) does support subscribing to events using SSE: https://docs.ntfy.sh/subscribe/api/#subscribe-as-sse-stream which uses a reasonable JSON payload format: https://docs.ntfy.sh/subscribe/api/#json-message-format, eg:

{
    "id": "sPs71M8A2T",
    "time": 1643935928,
    "expires": 1643936928,
    "event": "message",
    "topic": "mytopic",
    "priority": 5,
    "tags": [
        "warning",
        "skull"
    ],
    "click": "https://homecam.mynet.lan/incident/1234",
    "attachment": {
        "name": "camera.jpg",
        "type": "image/png",
        "size": 33848,
        "expires": 1643946728,
        "url": "https://ntfy.sh/file/sPs71M8A2T.png"
    },
    "title": "Unauthorized access detected",
    "message": "Movement detected in the yard. You better go check"
}

related

@wrenix
Copy link

wrenix commented Mar 1, 2025

I will suggestion to use the WebPush https://developer.mozilla.org/en-US/docs/Web/API/Push_API.

And to be valid with UnifiedPush.
PS: There is an UnifiedPush-Provider with is more stable then ntfy.sh and also use the WebPush-Server from mozilla on default - https://codeberg.org/sunup/android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants