Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove forground service #583

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Remove forground service #583

merged 1 commit into from
Apr 5, 2024

Conversation

hannesa2
Copy link
Owner

@hannesa2 hannesa2 commented Mar 9, 2024

No description provided.

@hannesa2 hannesa2 force-pushed the RemoveForegroundService branch 2 times, most recently from 1373264 to a481f07 Compare March 11, 2024 15:46
@NinaTietje
Copy link

Hi Hannes,
do you already know when you will include this in a new version?
If it's already working and you just need a few people to test it, let me know. :)

@hannesa2
Copy link
Owner Author

hannesa2 commented Mar 18, 2024

I was interrupted testing it, and I've no clue when I find time to continue. but you can test/use it as well
implementation 'com.github.hannesa2:paho.mqtt.android:RemoveForegroundService-4.2.3-ga481f07-13'

The main question is: does it need a foreground service when the stuff is working with Workmanager ?
Workmanager run just for seconds, then it need some special handling to run long running tasks, e.g connect and receive new massages.

@hannesa2
Copy link
Owner Author

hannesa2 commented Mar 18, 2024

If it's already working and you just need a few people to test it, let me know. :)

Nice. The missing test is:
Do you receive messages, when device is sleeping. The workmanager should awake device, receive messages and fall alseep again. This means you should send e.g every minute a messages over a period > 10 minutes and observe if a notification appears in status bar when device is in standby

@NinaTietje
Copy link

Hey Hannes,
here is what I tested: I ran your extendedSample from the RemoveForegroundService branch, unplugged the device, switched to the lock screen and published messages for some minutes. After a few minutes (not reached the 10 minutes) the notifications weren’t displayed anymore. In many cases the connection was lost (Lost connection notification) before the 10 minutes were reached. I also tested it while the app was in background and the screen was active, same results.
But I got the same behaviour for the extendedSample from 4.2.3.

Is there anything I should have done differently?
Tested on a Android 12 device.

@hannesa2
Copy link
Owner Author

Thanks a lot for your tests !
As there is no difference between the version and both stop working, maybe there is a general issue.
The connection lost should be normal, but it should reconnect and receive messages in WorkManager task.

Do you observe a working WorkManager task in the background ?

@NinaTietje
Copy link

I will try to check the WorkManager task in the next days or weeks.

@hannesa2 hannesa2 force-pushed the RemoveForegroundService branch from a121b7b to e8816ee Compare April 5, 2024 05:27
@kashyap-5paisa
Copy link

kashyap-5paisa commented Apr 5, 2024

LG!! Requesting to release this asap. 😌 Can you please let us know when are you planning for the update? Appreciated 👍

@hannesa2 hannesa2 merged commit e23ca63 into master Apr 5, 2024
2 checks passed
@hannesa2 hannesa2 deleted the RemoveForegroundService branch April 5, 2024 12:36
@hannesa2
Copy link
Owner Author

hannesa2 commented Apr 5, 2024

Here you go https://github.com/hannesa2/paho.mqtt.android/releases/tag/4.3-beta1
Please give me feedback if it works for you, independent if successful or not 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants