android
android copied to clipboard
Push: show real text instead of generic "new notification"
User want to see the real content of notification. As I understand this was due to a server bug, but can now be fixed for next version.
Haven't I fixed this already? xD
It shows the push subject, but not the content. Would it also be possible to show the complete content (as many text as fits into the notification?)
Working.
Is this released? I get this since the last update.

Yes, since ages. If you get this, it means that for some reason the content cannot be decrypted. Can you check if there are wrong app tokens in web->settings?
After debugging with @skjnldsv it turns out that those strange notifications only happens when the app is not in foreground.
I'm having this problem, too. Running client version 3.14.0 against server 19.0.5. I think it started after the upgrade from 19.0.4.
I'm having this problem, too. Running client version 3.14.0 against server 19.0.5. I think it started after the upgrade from 19.0.4.
Same here.
As far as I remember new_notification is the default value of push proxy, if no message is set. @nickvergessen do you have an idea why such messages might be sent?
I thought it was occurring when NC apps had updates available, but I got one of these this morning and I don't have any apps needing updates.
I'm not familiar with the language NC is written in, but it may have something similar to the Perl "caller" routine, which allows a routine to determine who called it. If you have such a thing, you might consider changing the default value to include the caller name or other identifier. That would make future occurrences easier to debug.
If I learn anything about the source, I'll update the ticket.
           -Brian M
On 11/25/20 1:41 AM, Tobias Kaminsky wrote:
As far as I remember new_notification is the default value of push proxy, if no message is set. @nickvergessen https://github.com/nickvergessen do you have an idea why such messages might be sent?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/1964#issuecomment-733591143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOA77LKIUFVD3UWG66TFTSRTGLBANCNFSM4ELZH6DA.
I had one of these shown as having occurred 4 hours ago. When I log into NextCloud with a web browser, I see a perfectly normal notification from PhoneTrack (with correct notification text) also shown as having occurred about 4 hours ago. I have no other notifications from around that time or since in either environment. This suggests that the notification within the Nextcloud server is handled normally, but is getting lost when picked up or presented by the Android client.
Have you removed account in question on Android or reset app token or something like that?
I had not made any change there. I know that the Nextcloud client still allowed me to access my files, make changes, etc. That suggests that the account credentials were operating normally, at least in some regards.
Nevertheless, I have now deleted the Android client account from the client, and then and re-added it using an app token. I'll advise you as to whether the problem goes away or continues.
On 11/27/20 12:44 AM, Tobias Kaminsky wrote:
Have you removed account in question on Android or reset app token or something like that?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/1964#issuecomment-734717427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOA7Y2LLQTWM5R2UMZRZLSR5RFVANCNFSM4ELZH6DA.
The problem still occurs. The NC web interface shows a proper notification (again all PhoneTrack in my case telling me I've reached my point quota, but I think that's just because I don't get many other notifications), but "NEW_NOTIFICATION NEW_NOTIFICATION" in the Android notification bar.
do you have an idea why such messages might be sent?
Just to answer this publicly here as well. The subject is the default subject we set. The encrypted subject should be decrypted and displayed instead by the client. However in this case it seems it either fails to decrypt or to load more information from the server.
However in this case it seems it either fails to decrypt or to load more information from the server.
At least on Android side we only show a notification if we can decrypt it and if we can get real info from server: https://github.com/nextcloud/android/blob/f0f467d2a10ffe0dc36663a2e81beb9ac96d578f/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt#L245-L250
I have no real idea how this could happen…
The subject is the default subject we set.
This is also encrypted, or?
This is what we do:
p := fcm.Notification{
Title: "NEW_NOTIFICATION",
TitleLocKey: "NEW_NOTIFICATION_TITLE",
Body: "NEW_NOTIFICATION", // Required for iOS
BodyLocKey: "NEW_NOTIFICATION_BODY", // Required for iOS
Sound: "default",
}
d := map[string]string{
"subject": n.Subject,
"signature": n.Signature,
}
return fcm.Message{
Notification: p,
Data: d,
To: n.pushToken,
ContentAvailable: true,
MutableContent: true,
Priority: priority,
}
So data contains the original encrypted subject, and the title + body are unencrypted, untranslated, generic placeholders
This is what I suspect: if for $strange reason, push proxy sends a notification to Android device with an old token, the Android device tries to match the token, but fails, then Android (!) still shows the notification, not our app.
I discussed this with @skjnldsv who even had removed any c.nc.c account, but still received a NEW_NOTIFICATION message, but in logcat none NotificationWork related info was shown.
I removed my last message, as it was a wrong assumption and thus the test would not have helped.
So we changed something in the way push messages are transferred to google cloud messaging. @MartinConsultingServicesInc can you try it again? Just create one push.
Notifications happen spontaneously. I don't know how to manually trigger one. I should have a spontaneous one later today, but if you want to tell me of a trick to force one, I'm happy to do it. Otherwise, I'll let you know how the next one goes.
That fixed it. Since late yesterday my notifications are coming in with the correct text.
I don't see that my Android Nextcloud client software has been updated in the last several days, and I haven't updated my server software. How am I seeing this change, then?
The Android app is registering with incorrect data/user agent on some android versions. The push proxy database had a lot of entries with type "unknown". After checking the patterns of the push tokens it seemed like those should all be from the android app and we manually reset the typo for them. It will be fixed in the next android app update. Until then we will observe and manually fix the type from time to time for newly registered devices.
Excellent. Thanks to you both for the prompt response.
The NEW_NOTIFICATONS are still sent on 3.14.3
Can confirm that this issue still persists.
App version: 3.14.3 Nextcloud Version: 20.0.5 Phone: Oneplus 8T Android Version: Oxygen OS 11.0.6.8.KB05AA
This is fixed with the upcoming 3.15.0
I've updated to 3.15 and still get NEW_NOTIFICATION instead of a proper notification text!
I'm also getting the same message and I'm behind NGINX
Android App: 3.15 Nextcloud: 20.0.7 Phone: Pixel 2 XL