wrk-fmd / CoCeMoCl

Coordination Center Mobile Client
MIT License
1 stars 0 forks source link

Location in background does not work #30

Closed heinrichmartin closed 5 years ago

heinrichmartin commented 5 years ago

Version 1.1.1.

Location updates work fine if the app is not in the foreground. Location updates do not work when the app is closed.

Bug: WHEN I close the app THEN the GPS indicator icon on the mobile blinks (disappears and re-appears) AND no location updates are available on the server

Additional requests were split to #31 and #32

robo-w commented 5 years ago

In Android versions <8 closing the app results in killing the process. Afterwards the service is spawned again:

02-24 11:52:53.525  9820  9820 I mono-stdout: Unregistering a location listener.
02-24 11:52:53.538  9820  9820 I mono-stdout: Unregistering a location listener.
02-24 11:52:53.544  9820  9820 D MainActivity: Main activity is being destroyed.
02-24 11:52:53.564  2057  2358 I ActivityManager: Killing 9820:at.wrk.fmd.cocemocl/u0a122 (adj 1001): remove task

02-24 11:52:54.618  2057  2090 I ActivityManager: Start proc 16568:at.wrk.fmd.cocemocl/u0a122 for service at.wrk.fmd.cocemocl/md53a7486b6668aea23782ebe21fa502cec.AndroidLocationService
...
02-24 11:52:56.500 16568 16568 D AndroidLocationService: Android specific location service was created.
02-24 11:52:56.548 16568 16568 I LocationProviderFactory: Google Play Services is installed on this device. Will be used as location provider.
02-24 11:52:56.668 16568 16568 D AndroidLocationService: LocationService received start command
...
02-24 11:53:01.218 16568 16568 I mono-stdout: Got 0 location listener instances to inform about updated location.

Cause: RestService singleton is registered as location listener in the startup of the App.cs. This needs to be changed to static initialization, which is also called on service-only startup.

robo-w commented 5 years ago

fixed with version 1.1.3