nextcloud / talk-android

📱😀 Video & audio calls through Nextcloud on Android
Other
529 stars 234 forks source link

Push notification are disabled #2529

Open XueSheng-GIT opened 1 year ago

XueSheng-GIT commented 1 year ago

Steps to reproduce

  1. Install Talk 15.0.1 (GPlay)
  2. Enter user credentials to login

Expected behaviour

Notifications should be enabled and available.

Actual behaviour

Message appears (just for a couple of milliseconeds) that push notifications are disabled. Push-notifications disabled I didn't find any way to see this information afterwards (e.g. settings menu). Notifications for other apps (including nextcloud) work just fine. See further details below (Additional information).

Device brand and model

Huawei Mate 40 Pro

Android version

11

Nextcloud Talk app version

15.0.1

Nextcloud server version

24.0.6

Talk version

14.0.5

Custom Signaling server configured

Yes (specify version in Additional Information)

Custom TURN server configured

Yes

Custom STUN server configured

Yes

Android logs

No response

Server log

No response

Additional information

Notifications were working before removing talk-android and reinstalling. Double checking the docs didn't help so far. https://github.com/nextcloud/talk-android/blob/master/docs/notifications.md

Battery optimizations are disabled for talk.

occ notification:test-push --talk <userid>
Trying to push to 3 devices

Language is set to de
Private user key size: 1704
Public user key size: 451
Identified 1 Talk devices and 2 others.

Device token:7887
Device token is valid
Device public key size: 451
Data to encrypt is: {"nid":25490,"app":"admin_notification_talk","subject":"Testing push notifications","type":"admin_notifications","id":"6357dacb"}
Signed encrypted push subject
Push notification sent successfully
XueSheng-GIT commented 1 year ago

Still trying to get push notifications working again. I removed talk app, removed the talk pushhash of the user (mysql table oc_notifications_pushhash), installed talk again and logged in with the user. Message still appears that push notifications are disabled and there's no new pushhash created. Why isn't a new pushhash created???

@mahibi Any hint how to debug this issue?

timkrueger commented 1 year ago

Hey @XueSheng-GIT. Thanks for your report.

I tried to reproduce that issue without success.

XueSheng-GIT commented 1 year ago

@timkrueger thanks for trying to reproduce!

* Is it possible for you to test with an other instance? Or did you already?

* Is it possible for you to collect logs with Android Studio?

I did try three different nextcloud instances (two running latest NC24, one running NC25). All with the same issue.

Never worked with android studio so far, but will try to gather some logs.

Just as an additional side note: the Huawei Mate40pro does not come with GAPPS, but I'm using microg to get push notifications. This works quite well and works without issues for the regular nextcloud app. Talk is registered to receive notifications, but according to microg no messages are received. I'll try to get some logs and will report back.

XueSheng-GIT commented 1 year ago

@timkrueger I did gather the log with adb and logcat (I assume android studio does the same). I don't feel comfortable publishing this log right here. Can I send it directly to you somehow?

UPDATE: Just had a quick look at the log myself and found the following lines:

10-31 15:26:23.516 27499 27797 W GooglePlayServicesUtil: com.nextcloud.talk2 requires Google Play services, but their signature is invalid. 10-31 15:26:23.516 27499 27797 W PushRegistrationWorker: executing PushRegistrationWorker doesn't make sense because Google Play Services are not available 10-31 15:26:23.518 27499 27760 I WM-WorkerWrapper: Worker result FAILURE for Work [ id=f4c5db59-4f49-4b01-a8d1-371161a3cfb9, tags={ com.nextcloud.talk.jobs.PushRegistrationWorker } ]

Seems it's really related to the missing GAPPS and microg. But as said earlier, other apps (including nextcloud itself) work just fine with microg and push notifications!

XueSheng-GIT commented 1 year ago

@timkrueger Do you still need the full log or is the extract mentioned above enough?

timkrueger commented 1 year ago

@timkrueger Do you still need the full log or is the extract mentioned above enough?

Please sent the logs to tim.krueger at nextcloud.com.

timkrueger commented 1 year ago

Is it possible for you to re-install Nextcloud Files? If push then still working with Files, we're more sure that this must be an Talk issue.

XueSheng-GIT commented 1 year ago

I did already re-install nextcloud files. But now did again (removed the app, installed again and entered the account details). Push notification is working as expected. I took a logcat, just in case it might be helpful. Should I send it to you?

tobiasKaminsky commented 1 year ago

@timkrueger I can test it tomorrow with microG, if needed.

XueSheng-GIT commented 1 year ago

@timkrueger I can test it tomorrow with microG, if needed.

One aspect which might be considered is that "signature spoofing" is not possible on (recent) huawei phones. I assume that microG is currently working without issues if signature spoofing is enabled/available.

tobiasKaminsky commented 1 year ago

Signature spoofing is indeed needed for a working microG.

XueSheng-GIT commented 1 year ago

Signature spoofing is indeed needed for a working microG.

I assume SafetyNet is the biggest issue if signature spoofing is not available. But signature spoofing should not be a requirement for push notifications. I'm using microG since nearly two years without signature spoofing and push notifications are working just fine (including a couple of banking apps and nextcloud files of course).

tobiasKaminsky commented 1 year ago

I am not that into it, but I understand that signature spoofing is needed to "trick" all google calls to be redirect from official gplay services to microG:

https://github.com/microg/GmsCore/wiki#system-requirements

Your Android system needs to support signature spoofing so GmsCore can pretend the existence of the official Play Services to applications calling Google APIs.

In your logcat I see:

10-31 15:26:23.516 27499 27797 W GooglePlayServicesUtil: com.nextcloud.talk2 requires Google Play services, but their signature is invalid.

which might indicate that this is not working.

tobiasKaminsky commented 1 year ago

But indeed it is strange that only Talk then needs it, as Files works.

tobiasKaminsky commented 1 year ago

Hm. While debugging this, I get a 409 when registering to https://push-notifications.nextcloud.com/devices

@nickvergessen do you know what this means? That there is already the same push token? But I installed Talk from scratch…

nickvergessen commented 1 year ago

do you know what this means? That there is already the same push token? But I installed Talk from scratch…

The device identifier (a hash of instance id, user id and auth token id) already is registered with a different user public key. I guess it can happen with dev instances and you didn't unsubscribe from the push server when the old account got removed.

This only affects unlucky developer cases, as on a real instance you can never get the same combination of instance + user + auth token, because the auth token is auto increment. Only when the instance is reset it can happen.

github-actions[bot] commented 1 year ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

XueSheng-GIT commented 1 year ago

Please don't close this issue.

github-actions[bot] commented 1 year ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

XueSheng-GIT commented 1 year ago

I'm on talk 15.1.1 now and issue is still present.

lukaszsobala commented 1 year ago

I have the same problem.

redtomaka commented 1 year ago

I have exaaclty same issue, nextcloud files works like a charm, nextcloud talk does register to microG but doesn't receive any notification (huawei P40 with microG, nextcloud files & talk from GPlay)

jenalj commented 1 year ago

Me too, using F-Droid versions on an unrooted Samsung and a single, non-developer instance. Tried reinstalling multiple times in every combination I could think of, always "push messages disabled", and "no device found" .

"Nextcloud Services" polling app works, I 'm using that in the meantime. (And whether you catch this bug or not: Thanks for your efforts!)

lukaszsobala commented 1 year ago

I fixed this by switching from lighttpd (which isn't supported anyway) to nginx.

jenalj commented 1 year ago

I fixed it by uninstalling the F-Droid version and installing from Google Play instead.

The F-Droid version of Talk works with MicroG -only-, it's not compatible with Google Play Services, as it turns out.

tobiasKaminsky commented 1 year ago

Fdroid version is FOSS, thus it cannot have any receiving parts of push notifications (as those are closed source by Google).

jtxnn678 commented 1 year ago

Issue still exists on NC.Talk 16.0

RedMi 11Pro 5G (All permission) Screen doesn't wake up upon receiving call & text, no notification or ring tone played.

4r1-60ld commented 1 year ago

Issue still present. Using latest Nextcloud-AIO. My Phone is a OnePlus 7 Pro with latest crDroid installed. When trying to enable notification, there is a message underneath the toggle stating "At your request, Android is blocking this category of notifications from appearing on your device". Have tried both F-Droid and GPlay version of Talk apps. Same issue. (v17.0.2)

4r1-60ld commented 1 year ago

Oh... and btw. Latest Nikgapps Core installed.

XueSheng-GIT commented 1 year ago

But indeed it is strange that only Talk then needs it, as Files works.

@tobiasKaminsky Unfortunately notifications are still not working for Nextcloud Talk 17.1.0 RC1, altough it works for Nextcloud app itself without issues. Did you find out why Talk needs to verify the signature while Nextcloud itself does not?

gguest2021 commented 1 year ago

But indeed it is strange that only Talk then needs it, as Files works.

@tobiasKaminsky Unfortunately notifications are still not working for Nextcloud Talk 17.1.0 RC1, altough it works for Nextcloud app itself without issues. Did you find out why Talk needs to verify the signature while Nextcloud itself does not?

Please help me, I have created my apk from the same source code without modifying anything and when I install and log in, the message appears: PUSH NOTIFICATION DISABLED .... Is there anything else to do?

OBS: I use source code version apk 17.0.2

mahibi commented 9 months ago

Please let me know if the issue is fixed when v18.0.0 is released. It will introduce fixes for notifications and account deletion. If you already want to try out the release candidates, feel free to join https://github.com/nextcloud/talk-android#via-google-play

XueSheng-GIT commented 9 months ago

@mahibi I've updated to 18rc2, deleted one of three active accounts and added it again... notifications are still disabled.

Anything special which has to be done after upgrade?

foegra commented 7 months ago

same problem here with oneplus phone, stock firmware.

mahibi commented 7 months ago

I recently created a diagnosis screen and checks for permissions in https://github.com/nextcloud/talk-android/pull/3558 It's not released yet, but it would be interesting if you could try it out and paste the reports here. If you're willing to do so, please install apk from https://github.com/nextcloud/talk-android/pull/3558#issuecomment-1888707964 (or from alpha release channel: https://github.com/nextcloud/talk-android#via-google-play-1)

Then go to settings (and check if any permissions are marked with red color). Then open diagnosis screen (see advanced section in settings), copy the report (upper right corner) and paste in here.

bene64 commented 4 months ago

I also didn't get notifications with my installation (just until now). Below the information from the diagnosis screen.

What's not in there:

=> So SafetyNet is probably the missing part in some of the cases here

So a check + warning for missing SafetyNet could probably be a valid workaround here. But I would also appreciate support for UnifiedPush (https://github.com/nextcloud/talk-android/issues/257) 😉

Meta-Information

Erzeugung des Systemberichts

24.04.2024 09:20:03

Telefon

Gerät

Google Pixel 4a

Android-Version

34

Google Play-Dienste

Google Play-Dienste sind verfügbar

App

App-Name

Nextcloud Talk

App-Version

v18.1.0

Build flavor

gplay

Batterie-Einstellungen

Batterieoptimierung wird ignoriert, alles in Ordnung

Benachrichtigungsberechtigungen

Benachrichtigungen werden gewährt

Anrufbenachrichtigungskanal aktiviert?

true

Nachrichtenbenachrichtigungskanal aktiviert?

true

Firebase-Push-Token

Kein Firebase-Push-Token festgelegt. Bitte erstellen Sie einen Fehlerbericht.

Neueste Firebase-Push-Token-Generation

Unbekannt

Neuester Firebase-Push-Token-Abruf

Unbekannt

Registrierte Benutzer

redacted

Aktuelles Konto

Server

redacted

Benutzer

redacted

Benutzerstatus aktiviert?

Ja

Server-Benachrichtigungs-App installiert?

Ja

Aktuelle Push-Registrierung am Server

Noch nicht am Server registriert

Aktuelle Push-Registrierung beim Push-Proxy

Noch nicht beim Push-Proxy registriert

Serverversion

28.0.3

Serverversion von Talk

18.0.5

Signalisierungsmodus

Intern

mahibi commented 4 months ago

=> So SafetyNet is probably the missing part in some of the cases here

Thanks to share this information @bene64. I'll have to read up on it a bit..

XueSheng-GIT commented 4 months ago

SaftetyNet depends on working signature spoofing. Thus, missing signature spoofing is generally the issue if apps complain about missing gplay. There are devices (like my Huawei Mate 40 Pro) on which you cannot enable signature spoofing.

But, the main point is that signature spoofing is not required for push notifications. Push notifications are working for most of the apps and if you installed Talk long time ago, push notifications are also working properly because the device was already registered. E.g. I own two Mate 40 Pro. On one of them I uninstalled Talk and I'm not able to get push notifications working again. On the other device it is just working because device registration was done differently back at the time.

@mahibi Talk should just try to register for push even if gplay is "officially" missing. Some other apps are e.g. complaining about missing gplay and notify that the app may not work proberly, but still work without issues. Should be the same for Talk.

XueSheng-GIT commented 1 month ago

@mahibi I'm on Talk-Android 19.0.1 now and this issue still persists. The Nextcloud app itself is still able to register for push notifications on the same device (still without signature spoofing). Isn't it possible to use the same push registration like the Nextcloud app does?

Alternatively, is there a way to register for push manually somehow?

XueSheng-GIT commented 17 hours ago

I had another look at this issue... Just as a reminder: push notifications for Nextcloud android are working with no issues (for other apps it's also no issue on my Huawei Mate 40 Pro). Only Nextcloud Talk does not work as expected.

For Nextcloud android, the check for available of Gplay is done here: https://github.com/nextcloud/android/blob/f445f0f34d77c946aa61cf5f6538203f5aec431e/app/src/gplay/java/com/owncloud/android/utils/GooglePlayUtils.kt#L19-L33

For Nextcloud Talk this check is done here: https://github.com/nextcloud/android/blob/f445f0f34d77c946aa61cf5f6538203f5aec431e/app/src/gplay/java/com/owncloud/android/utils/GooglePlayUtils.kt#L19-L33

The main difference seems to be how resultCode or code are defined. Actually, those different approaches are not clear to me (I'm no developer).

resultCode for Nextcloud Talk is 9 (SERVICE_INVALID) on my device.

Thus, I tried adding this code as acceptable and changed https://github.com/nextcloud/talk-android/blob/60ecfa72c592a5a7341f1ebb255ac0ebe3c214ed/app/src/gplay/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.kt#L54 to

return if (code == ConnectionResult.SUCCESS || code == ConnectionResult.SERVICE_INVALID) {`

Now push notifications are working again on my device!!!

@tobiasKaminsky as said, I'm no developer. But maybe you can explain, what the difference is in definition of code vs. resultCode (see linked functions above). As code is SUCCESS and resultCode is SERVICE_INVALID on the same device. Finally, I do understand that some Huawei devices are lacking proper gplay support, but push notifications do not depend on available signature spoofing (microg).

CC @mahibi @timkrueger