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

Push notification are disabled #2529

Open
XueSheng-GIT opened this issue Oct 25, 2022 · 41 comments
Open

Push notification are disabled #2529

XueSheng-GIT opened this issue Oct 25, 2022 · 41 comments
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) bug Something isn't working feature: 🔔 notifications

Comments

@XueSheng-GIT
Copy link

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 XueSheng-GIT added 0. Needs triage bug Something isn't working labels Oct 25, 2022
@XueSheng-GIT
Copy link
Author

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
Copy link
Contributor

Hey @XueSheng-GIT. Thanks for your report.

I tried to reproduce that issue without success.

  • 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?

@timkrueger timkrueger added the needs info Not enough information provided label Oct 31, 2022
@XueSheng-GIT
Copy link
Author

@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
Copy link
Author

XueSheng-GIT commented Oct 31, 2022

@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
Copy link
Author

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

@timkrueger
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Member

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

@XueSheng-GIT
Copy link
Author

@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
Copy link
Member

Signature spoofing is indeed needed for a working microG.

@XueSheng-GIT
Copy link
Author

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
Copy link
Member

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
Copy link
Member

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

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Nov 16, 2022

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
Copy link
Member

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

This comment has been minimized.

@github-actions github-actions bot added the stale On hold label Dec 15, 2022
@XueSheng-GIT

This comment has been minimized.

@github-actions github-actions bot removed the stale On hold label Dec 23, 2022
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale On hold label Jan 20, 2023
@XueSheng-GIT
Copy link
Author

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

@nickvergessen nickvergessen added 1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) and removed stale On hold needs info Not enough information provided 0. Needs triage labels Jan 20, 2023
@lukaszsobala
Copy link

I have the same problem.

@redtomaka
Copy link

redtomaka commented Feb 15, 2023

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
Copy link

jenalj commented Mar 12, 2023

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
Copy link

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

@jenalj
Copy link

jenalj commented Mar 12, 2023

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
Copy link
Member

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

@jtxnn678
Copy link

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
Copy link

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
Copy link

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

@XueSheng-GIT
Copy link
Author

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
Copy link

gguest2021 commented Sep 5, 2023

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
Copy link
Collaborator

mahibi commented Dec 7, 2023

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
Copy link
Author

@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
Copy link

foegra commented Jan 16, 2024

same problem here with oneplus phone, stock firmware.

@mahibi
Copy link
Collaborator

mahibi commented Jan 19, 2024

I recently created a diagnosis screen and checks for permissions in #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 #3558 (comment) (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
Copy link

bene64 commented Apr 24, 2024

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

What's not in there:

  • Android is LineageOS for microG 21
  • App is in the work profile (via Shelter), but microG + FCM notifications works there too for other apps
  • microG settings were all on (Device Registration, Cloud Messaging, SignatureSpoofing, ...) except for SafetyNet
  • as I read in Push notification are disabled #2529 (comment) maybe SafetyNet could be the root issue, I enabled it. After restarting Talk, it successfully registered a Token and in microG Cloud Messaging

=> 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 (#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
Copy link
Collaborator

mahibi commented Apr 24, 2024

=> 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
Copy link
Author

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
Copy link
Author

@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
Copy link
Author

XueSheng-GIT commented Sep 7, 2024

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-L32

For Nextcloud Talk this check is done here:

private fun isGPlayServicesAvailable(): Boolean {
val api = GoogleApiAvailability.getInstance()
val code =
NextcloudTalkApplication.sharedApplication?.let {
api.isGooglePlayServicesAvailable(it.applicationContext)
}
return if (code == ConnectionResult.SUCCESS) {
true
} else {
Log.w(TAG, "GooglePlayServices are not available. Code:$code")
false
}
}

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

return if (code == ConnectionResult.SUCCESS) {

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

@mahibi
Copy link
Collaborator

mahibi commented Sep 23, 2024

From what i see the check itself is not a problem. But i see that there is a difference when the check is actually triggered. On talk app it's triggered quite often, for files app it's triggered only rarely or not at all depending on the scenario. Instead the files app seem to rely on if a push token is actually saved in the settings.
Diving deeper here seems to take more time than i thought.

I fear just allowing to continue with ConnectionResult.SERVICE_INVALID will cause more trouble than it solves in the end.

For the long term we plan to extract the login screens and push stuff to a shared library so talk and files app use the same code base. It may have to wait for this which then should also fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) bug Something isn't working feature: 🔔 notifications
Projects
None yet
Development

No branches or pull requests