Implement notifications API with mobile clients

We start using the Notifications API of the server more and more.
At the moment the following things are implements:

  • Accepting/declining of federated shares (already exists)
  • Notification about new updates (coming with the next major)

And more will come, like quota warning, etc.

It would be nice to also get this notifications on the smartphone.
The API is stable implemented as OCS API, documentation can be found at

PS: polling ~5mins should be okay

@Andy and the other android staff

@nickvergessen looks good to me, we might need to have some more clarification down the road for some details though.
cc @tobiasKaminsky and @przybylski

Two questions though:

  • When will this be available on the server side (stable version)?
  • What should we do with this exactly?
    • just display the list of messages we retrieved?
    • is this like an endless feed? Should the messages be discarded after they have been viewed
    • are there any screenshots from the server how the notifications are being rendered and are all of them rendered the same way?

Thanks to Android N the polling is something we need to investigate since Android N got really restrictive here but this seems to be a nice, small and isolated piece of functionality where we can start digging into it.

The functionality is there since NC9 (OC 9.0). The app is shipped since OC 8.2, but the OCS api was only added in 9.0+. Since it’s an app, you might want to check the /cloud/capabilities endpoint if it was disabled.

In the web UI notifications are displayed, until you choose one of the actions (or if no actions are available for the notification, until you dismiss it with a little cross, e.g. announcement center).
Now I know that this is not something we want to have on our phones, so maybe we can have both, a full list in the app itself, and a android notification for new items (can be checked by ID). That is what I would think, but I leave this up to you.
I think the desktop client behaves similar, at least they have a list above the activity stream. I never saw popup notifications for new items thou.

A simple screenshot is in the readme:
Basically all should be rendered the same way (no content sniffing).

Of course I help with any upcoming questions.

So a first step could be do simply load the notifications and display them in a list, sync mechanism to look for new notifications after a fixed amount of time. As for the notification part… that is a tricky one where I would like to consult @jan. Sending a native notification on an Android device or iOS too is something we shouldn’t use to much since it is a distraction for the user where we should have a really good reason to do so and Nextcloud server side action feeds a probably not one of them or just in certain scenarios. Need to further think about the notification part how we could do this without annoying the user. This gets even more important if you run a multi user setup on your phone (like I do), so question is should we fetch notifications for all known accounts or just the currently active one. If you receive a notification for a currently not active one and click on the Android notification you probably want to get to the list of notifications which also means we have to do a user context switch on the fly.

@Andy can you transfer this is in issue on github and sum it up a little bit?
Would love to built/discuss this on the conference :slight_smile:

@tobiasKaminsky yes! I will see that I do this in the upcoming week :thumbsup:

1 Like