Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.21k stars 566 forks source link

Android agent receives notifications from domain not registered on ... #2306

Closed vitko-bg closed 3 years ago

vitko-bg commented 3 years ago

Hi @Ylianst , sorry for bothering you again, but I think it is a big issue with MC2 when messaging an Android Agent.

Feel free to test it on the test environment provided to you in our mail chain.

Steps to reproduce:

I tested it on completely different MC2 servers, on different domains running on one MC2 server - in both cases result is the same. Issue is the same when using more than one domain on MC2 server config file (as in my case - 1 main and 2 extra )

Ylianst commented 3 years ago

Ha yes, I expected this problem. The way push notifications works, once the device sends it's notification token to the server, there is no easy way to know that it's not a valid token anymore. I have to work on something to fix this.

Ylianst commented 3 years ago

Started doing some work on this. Made changes to both future Android Agent and MeshCentral server.

Ylianst commented 3 years ago

Published MeshCentral v0.7.73 and Android Agent v1.0.5 with fixes for this. You may see the fix only once you re-register your Android device. The server will now assign the push notification token to only one device in the server, but it will start once you remove and re-connect the device. Also, the server ID is now sent in each notification and so, if the received notification does not have the right server ID, the push message is ignored in some cases. That should fix it.