Skip to content

Feat: Add UnifiedPush support#16526

Open
p1gp1g wants to merge 19 commits intonextcloud:masterfrom
p1gp1g:feat/unifiedpush
Open

Feat: Add UnifiedPush support#16526
p1gp1g wants to merge 19 commits intonextcloud:masterfrom
p1gp1g:feat/unifiedpush

Conversation

@p1gp1g
Copy link

@p1gp1g p1gp1g commented Feb 16, 2026

Following web push support in nextcloud/notifications, we can add UnifiedPush support to the Android application*, to get push notifications even without the Play Services.

The implementation follows this guide: https://unifiedpush.org/developers/ux/

  • During startup:
    • The GPlay flavor (and the others) uses FCM by default
    • The generic flavor uses UnifiedPush by default, and will use it if a distributor (= an application that can be used as a Push Service) is available
    • With the generic flavor, if the user has many distributors and hasn't selected a default yet (nearly never the case - the default is a OS wide default), a dialog is shown to introduce the OS screen.
  • Settings:
    • On the 2 flavors, if a distributor is available, you have a new setting that allows to enable/disable UnifiedPush
    • If the user has many distributors (nearly never the case - but that means the user knows what UnifiedPush is!), a 2nd setting is offered, to change the distributor

This feature also gives the possibility to get Push Notifications with the Play Services, without the proxy (Nextcloud servers directly push to Google FCM servers), and without a proprietary library. So this is an accepted way to use FCM for application in F-Droid. => This is in a 2nd PR, already ready.

Fix #11898
Fix #5510
Fix #8684
Fix #3333 (with the 2nd PR)

* We could add it to the Linux app too, but I haven't, at least yet.

🖼️ Screenshots

Coming, I will update this description

🏚️ Before 🏡 After
image Screenshot From 2026-02-16 23-11-48

🏁 Checklist

  • Tests written, or not not needed : I don't know what can be done

@p1gp1g
Copy link
Author

p1gp1g commented Feb 16, 2026

And I'll start by fixing some conflicts 👍

Signed-off-by: sim <git@sgougeon.fr>
The capability doesn't have an accountName, and therefore doesn't update the user cache

Signed-off-by: sim <git@sgougeon.fr>
…e message

Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
To catch easily when we do UnifiedPush or Common push tasks

Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
… a distributor

Signed-off-by: sim <git@sgougeon.fr>
…nregistration

Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
private fun appTypes(): List<String> = context.packageManager
.getLaunchIntentForPackage(APP_NEXTCLOUD_TALK)?.let {
listOf("all", "-talk")
} ?: listOf("all")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is to get all notifications, except talk ones if talk is installed. But:

  • We can decide to never receive talk notifications (if a user wants talk notif, they probably use Talk app)
  • And it would be better to list the applications we want to receive notifications from

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about talk notifications? Is it expected that the talk app will independently handle unifiedpush notifications too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm cleaning up the code to open the pull request

@p1gp1g p1gp1g changed the title Feat/unifiedpush Feat: Add UnifiedPush support Feb 18, 2026
@JvmStatic
fun registerCurrentPushConfiguration(activity: Activity, accountManager: UserAccountManager, preferences: AppPreferences) {
if (
(!preferences.isPushInitialized && BuildConfig.DEFAULT_PUSH_UNIFIEDPUSH)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a BuildConfig, we could add a function isPlayServiceAvailable to PushUtils (Implemented per flavor, dedicated to FCM and proxy-push) to check if the Play Services are available.

That way, a user using the gplay flavor on a phone without the Play Services can use by default UnifiedPush.

But it introduces a bit more change, and it is a bit less readable. As you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants