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

Notifications doesn't work properly on Android with UnifiedPush #544

Open
parrazam opened this issue Aug 25, 2023 · 10 comments
Open

Notifications doesn't work properly on Android with UnifiedPush #544

parrazam opened this issue Aug 25, 2023 · 10 comments

Comments

@parrazam
Copy link

Bug Description

I have 2 accounts registered in FluffyChat, one using the default server matrix.org and another one using a custom server. I'm using Ntfy as notification server.

When I add both accounts in the app, the first one register the device in the Ntfy server. However, the second one doesn't. So I can receive notifications for the first account but not for the second one.

Steps to Reproduce

  1. Log in in the app with an account.
  2. Check that the notification device is registered under Settings -> Notifications -> Devices
  3. Log in with another account from a different server.
  4. Go to Settings -> Notifications -> Devices and no one device was registered.
  5. Send a message to the first account. It will be notified.
  6. Send a message to the second account. It won't be notified :(

Expected Behavior

Each account should register in the unifiedpush server, in order to manage notifications independently.

App Version

1.13.0

Additional Platform Information

Device: OnePlus 8T, OS: Android 13

Additional Context

No response

Copy link

This issue is stale because it has been open for 120 days with no activity.

@github-actions github-actions bot added the stale The item is going to be closed soon because of inactivity label Dec 24, 2023
@marcan
Copy link

marcan commented Dec 24, 2023

This is stilll broken.

@github-actions github-actions bot removed the stale The item is going to be closed soon because of inactivity label Dec 25, 2023
@Doomsdayrs
Copy link

Just found this out as I was starting to use FluffyChat for my multiple accounts

@cassandracomar
Copy link

I tested this by enabling and disabling notifications for each account. each time I do so for one account, I can receive notifications for that account (DMs only -- notifications for group chats never work) but not the other.

@TimSchimansky
Copy link

Yes this is also happening with the google play version, which I installed in the hope to fix this, but I only get DM-notifications for the first account. (Both are custom servers)

@squatica
Copy link

If you are really desperate, here is how to register a pusher manually by directly calling the matrix API:

First you will need you access token and the url of the matrix api.

Api url is easy, take the domain part of your account name (such as "matrix.org") and look at https://matrix.org/.well-known/matrix/client - if they show m.homeserver -> base_url then that is the API url, if not, then the domain part of your account name is the API url. Matrix.org has api at https://matrix-client.matrix.org. Do this for both of your accounts and let's call them MATRIX_HOST_1 and MATRIX_HOST_2.

To get the access tokens, you can either steal them from a web client by inspecting the Authorization headers (any access token of the particular user account should work). I don't know how to get it from Fluffychat, but we could just do a new login on command line:

(Be extra careful with that access token, and that curl command containing your password. If you don't know how to avoid leaking them, or accidentally storing them in some cache or history, don't proceed.)

curl -XPOST -H "Content-Type: application/json" \
  -d '{"type":"m.login.password","identifier":{"type":"m.id.user","user":"YourUsernameHere"},"password":"YourPasswordHere"}' \
  "${MATRIX_HOST_1}/_matrix/client/v3/login"

Get both access tokens, let's call them ACCESS_TOKEN_1 and ACCESS_TOKEN_2.

Get the pusher settings from the first account (the one where push notifications work):

curl -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${ACCESS_TOKEN_1}" \
  "${MATRIX_HOST_1}/_matrix/client/v3/pushers"

From the response take only the object inside pushers:[...] and add this part: "append":true - this can be done with jq:

curl ..../pushers | jq -rc '.pushers[0]+{append:true}'

Now send the resulting json object to the second account's api, to set the pusher:

curl -XPOST -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${ACCESS_TOKEN_2}" \
  --data '{"app_display_name":"..."... ,"append":true}' \
  "${MATRIX_HOST_2}/_matrix/client/v3/pushers/set"

This will effectively clone the exact same UnifiedPush settings from your first account. Now fluffy should be getting the notifications, however it's not 100% ideal, seems like fluffy will show the username of the first account, but at least the notification is there and clicking it opens the correct room in correct account.

Of course this is super hacky solution, so only do this if you are willing to solve whatever breaks. So far it seems to have worked for me, YMMV.

@gusarg81
Copy link

Yes this is also happening with the google play version, which I installed in the hope to fix this, but I only get DM-notifications for the first account. (Both are custom servers)

Hi, I second this. I've reinstalled using Google Play (because was not working with Ntfy) and still notifications does not work.

I have 2 accounts. Boths with self hosted servers. With Element Notifications does work.

@Yarrax
Copy link

Yarrax commented Oct 14, 2024

It's still actual bug.
Android 14, Fluffy 1.22.0
I receive push from first account and dont receive form second account.

@gusarg81
Copy link

It's still actual bug. Android 14, Fluffy 1.22.0 I receive push from first account and dont receive form second account.

Yes, the same is happening to me too currently.

@baltevl
Copy link
Contributor

baltevl commented Nov 7, 2024

I have written pr #1443 to fix this. Any feedback and/or testing is welcome :)

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

9 participants