0xf104a / NextcloudServices

Android app to send notifications from Nextcloud without using GCM(Google cloud messaging)
GNU General Public License v3.0
63 stars 11 forks source link

No notifications are displayed #87

Closed mikoladz closed 2 months ago

mikoladz commented 3 months ago

Nextcloud Services is properly configured with Nextcloud account (from the Nextcloud app), the status says "connected", but still there are no notifications. Nextcloud Services: 1.1-beta19 OS: LineageOS 21-20240513-microg-shiba/Android 14 NC Server: 28.0.5

IpeTek commented 3 months ago

I have the same problem. But on stock Android 14, Samsung.

randoentity commented 3 months ago

1718138552.306 19506 19506 W Notification.NotificationBuilder: No processors are registered. Resulting notification would be likely invalid 1718138553.819 19506 19569 E Notification.NotificationController: Failed to parse notification
1718138553.820 19506 19569 W System.err: java.lang.IllegalArgumentException: com.polar.nextcloudservices: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.

Same issue. On another device running older Android notifications work. The above log snippet looks relevant to me.

0xf104a commented 3 months ago

Hello. Sorry for quite long update of app. The issue(#78) is already fixed in PR #79. I've just created a new release, so it should be built in next few days to be available on F-Droid

randoentity commented 2 months ago

I've been testing beta20 and it doesn't seem to be fully working for me. I do get app update notifications, but not talk notifications. There are a lot of access denied errors, but the following stands out: 06-16 19:07:44.829 7348 7348 W Notification.NotificationBuilder: No processors are registered. Resulting notification would be likely invalid I'll try clearing the data tomorrow.

mikoladz commented 2 months ago

I'm also on beta20 and now the notifications are displayed, however it looks like dismissing them does not clear them on the NC server ("Remove notifications on dismiss" is enabled in the app).

randoentity commented 2 months ago

I'm getting ANRs now. It looks like it wants to do something with the webview. I have "open talk notifications in browser off". I think it defaulted to on, but talk notifications weren't working then either.

I'm not sure if these logs are helpful: anr-ns.log

But I also get a lot of avc's, for example:

06-18 03:52:12.428 26276 26276 I auditd : avc=type=1400 audit(0.0:33581): avc: denied { read } for comm="app_process64" name="u:object_r:userdebug_or_eng_prop:s0" dev="tmpfs" ino=373 scontext=u:r:untrusted_app:s0:c5,c257,c512,c768 tcontext=u:object_r:userdebug_or_eng_prop:s0 tclass=file permissive=0 app=com.polar.nextcloudservices

freeflyk commented 2 months ago

@mikoladz You are right, dismiss of the messages does not work. I found that the problem is related to changes regarding the broadcasting receiver that were made in android 14 (https://developer.android.com/about/versions/14/behavior-changes-14?hl=en#runtime-receivers-exported). In the app the boradcast receiver is annotated to listen only to the app itself (which I consider correct), but the package name of the app is not passed to the event. Thus, there is a trigger to dismiss the notification, but it is actually ignored by the receiver since the package name is missing. @0x50f13 I added the lines and submitted a pull request. Dismissal of notifications now works on my android 14 device...

0xf104a commented 2 months ago

Thankyou @freeflyk ! The issue seems to be resolved, so closing it

randoentity commented 2 months ago

@0x50f13 I'm still getting regular ANRs on stock GrapheneOS. I've included the logs above. Did I do it wrong? If I manually open the app the notifications come in, but it crashes in the background. I've set it to unrestricted but that didn't help.