cyanomiko / dcnnt-py

UI-less tool to connect Android phone with desktop
MIT License
186 stars 9 forks source link

Notifications are not displayed #1

Closed sphh closed 3 years ago

sphh commented 4 years ago

I don't know if this is a problem of dcnnt-py or dcnnt-android, so I start here.

I have set up dcnnt both on my laptop and my Android device. I can upload files from the Android to my laptop, but I do not receive any notifications. The notification access is granted on the Android device.

When starting dcnnt-py in the foreground, I get the following output when uploading a file to the laptop:

Loading device data from file "/home/sph/.config/dcnnt/devices/159201536.device.json"
START APP
Starting UDP server...
Starting TCP server...
Press Enter to stop app...Send header response - 60 bytes
Enter plugin: "FileTransferPlugin"
[FileTransferPlugin] b'{"jsonrpc":"2.0","method":"upload","params":{"name":"Todo-backup-2020-02-14-09-00-57-685.json","size":2952},"id":1}'
[FileTransferPlugin] <dcnnt.common.jsonrpc.RPCRequest object at 0x7f9d2b7f7e88>
[FileTransferPlugin] Receiving 2952 bytes to file /home/sph/Downloads/Todo-backup-2020-02-14-09-00-57-685.json
[FileTransferPlugin] Sent: {"jsonrpc": "2.0", "id": 1, "result": {"code": 0, "message": "OK"}}
[FileTransferPlugin] File received (2952 bytes)
[FileTransferPlugin] Sent: {"jsonrpc": "2.0", "id": 1, "result": {"code": 0, "message": "OK"}}
[FileTransferPlugin] None
[FileTransferPlugin] [FileTransferPlugin] No more requests, stop handler
Exit plugin: "FileTransferPlugin"

There are no entries when a notification pops up on the Android.

The configuration file .config/dcnnt/plugins/nots.conf.json looks like this:

{
  "icon_path": "/tmp/dc-icon.png",
  "cmd": "notify-send -i '{icon}' '{title}' '{text}'"
}

/tmp/ and notify-send do exist.

dcnnt-py is pulled from github with the commit https://github.com/cyanomiko/dcnnt-py/commit/2f912f9517a6643482a3029b8f0706ef9fe45a08 included.

dcnnt-android is installed from F-Droid and of version 0.3.7.

Do you have any idea why this is not working? Do you need anything else to pinpoint the problem? I am happy to provide it!

cyanomiko commented 4 years ago

@sphh, likely settings of Android app cause this problem. Need some additional information. What version of Android running on your phone? Is notification access enabled for Device Connect app (check Settings -> Notification service in sidebar menu)? Are notification transmission enabled for apps and devices that you use (check Notifications in sidebar menu)?

Also, there is known bug in notification plugin cause icons not shown on desktop side sometimes. Will be fixed soon.

sphh commented 4 years ago

Thanks.

To answer your questions:

  1. Android 8.1
  2. Notification access is enabled (just checked it)
  3. Notification transmission is enabled with ALL for let's say QKSMS both for selected device Common and my laptop
    • Device connect is connected to my laptop
    • Sending a text message to myself gives a notification on my Android device
    • No notification on the laptop and not lines in the log on the Android
sphh commented 4 years ago

I forgot to mention, that power saving and battery optimization is switched off for Device connect.

cyanomiko commented 4 years ago

@sphh, maybe Android blocks access to QKSMS notifications because of Device Connect has not SMS access permissions. Did you try to get notifications from another app not using SMS or telephony?

sphh commented 4 years ago

The problem for me is, that I have to initiate a notification to test it. I know that Netguard issues a notification when I install a new app. So I enabled ALL for Netguard in the Common section and the section for my laptop.

Then I installed an app. I get Netguards's notification on the Android Device, but nothing (not notification, nothing in the logs) on my laptop.

Do you know which notification works for certain, so that I can try it, e.g. would the notification of the countdown timer work?

cyanomiko commented 4 years ago

Messengers and online chat apps are handy for testing notifications. I use Telegram for testing.

sphh commented 4 years ago

Well, that's why I used QKSMS...

How should I proceed to get this working? It does not work with QKSMS and not with Netguard. Any other idea?

cyanomiko commented 4 years ago

There is easy way to create notification using browser (tested on Firefox) - just save any picture and download notication appears. And one point on Android 8 - check if DConnect Notification listener are in Device Connect page Settings -> Developer options -> Running services.

sphh commented 4 years ago

I found the settings under Settings > System > Developer options > Running services... There is no DConnect there.

Device Connect has access to Notifications (Special app access > Notification access shows Device Connect enabled) and permissions to access the storage.

Is the missing DConnect Notification listener the problem? How to I get it running?

cyanomiko commented 4 years ago

Yes. Application does not even get notification to process and send to PC. Some system restrictions or bug in code may cause such problem. Maybe search in system logs will be helpful.

sphh commented 4 years ago

What should I search for in the system logs?

cyanomiko commented 4 years ago

Any records related to notifications. Any records contains net.dcnnt or DConnect substrings.

cyanomiko commented 3 years ago

Closed due to inactivity.

Ao1Pointblank commented 1 year ago

This notifications issue still persists in v0.10.0, from Fdroid, on Android 13. I installed the computer half of the system with pip, and got other plugins to work fine (except Downloading files from computer, I will write another report on that)