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

Implement UnifiedPush #2798

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

Garland-g
Copy link

This PR implements UnifiedPush support and adds a settings page to enable and disable it.

After enabling, a target URL will be displayed in the settings. One more step is required: Open the Bluebubbles Server settings, and add a Webhook that sends New Messages events to the target URL. Push notifications will work, even after the app is killed.

On the latest release (v1.13.2), the socket service accounted for ~33% of the battery usage on mostly-idle Pixel 8 Pro. When using this branch, battery usage dropped to < 1% while receiving push notifications.

Closes #2274

@cameronaaron
Copy link

In the latest version they are adding in forground service which might make this moot

@zlshames
Copy link
Member

zlshames commented Sep 8, 2024

Sounds to me

In the latest version they are adding in forground service which might make this moot

Sounds to me like this is a firebase replacement more than a background service replacement. Maybe I'm wrong? But it seems like yeah, the current foreground service implementation drains battery fast, but I'm not sure how much better the true background service changes I made would improve on that. I think it does significantly, but maybe unified push is still more efficient?

I still need to look at the code changes, so..

@Garland-g
Copy link
Author

Sounds to me like this is a firebase replacement

Precisely.

No bluebubbles code needs to run in the background at all when either FCM or UnifiedPush is being used. In both cases a separate service listens for incoming push notifications and distributes notifications to the correct applications.

Copy link
Member

@zlshames zlshames left a comment

Choose a reason for hiding this comment

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

At a quick glance, the code looks all good. I'll need to do a full review of it when I have some more time. Will definitely try to get this merged for the next next release

Copy link
Member

Choose a reason for hiding this comment

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

Any reason why you are referencing a specific commit here? Maybe I'm mistaking the SHA prefix for something else... But if rather not reference a specific commit and rather, the latest stable branch

Copy link
Author

@Garland-g Garland-g Sep 8, 2024

Choose a reason for hiding this comment

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

There wasn't a recent release tag listed when I imported the library for development.

While I was testing my code they added a new release that I didn't see. I've made the change to import that release.

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

Successfully merging this pull request may close these issues.

3 participants