traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
666 stars 737 forks source link

Error creating a shortcut for start or stop service #442

Open DST73 opened 1 year ago

DST73 commented 1 year ago

Describe the bug I was using MacroDroid to start and stop the service under certain conditions. Everything worked well on my S9+ running Android 9. Even under Android 12 everything works well (The dev of MacroDroid checked that). But under Android 13 I get an error.

To Reproduce Steps to reproduce the behavior: See screenshot in macrodroidforum: <"Launch Shortcut" not working>

Expected behavior that the macro can start and stop the service

Screenshots See link above.

Smartphone (please complete the following information):

Additional context That it is related to MacroDroid was ruled out. He although check it with the app Automate what had the same behavior.

tananaev commented 1 year ago

Does the shortcut work manually?

DST73 commented 1 year ago

It works manually if I long press on the icon

tananaev commented 1 year ago

Probably related to this:

https://developer.android.com/about/versions/13/behavior-changes-all#intents

DST73 commented 1 year ago

Is that something you can fix or does this the dev of macro droid have to fix? Thank you!

tananaev commented 1 year ago

I think this might fix the problem: https://github.com/traccar/traccar-client-android/commit/ddf1f0fbe02e8282a278b29bfff5c0fe371a2c23.

Can you please try this APK to confirm that it works:

https://we.tl/t-70d37WBHGc

DST73 commented 1 year ago

Hi, thanks, I have tried the app.

There error message in MacroDroid is gone but what it does when I execute the macro is that it opens the Traccar Client up, shows an toast that the Service is started but you can see by the slider Servicestatus that it isn't started.

So the error in MacroDroid is gone but it opens the app instead of starting the service

tananaev commented 1 year ago

If it shows the toast, it should start the service.

DST73 commented 1 year ago

Tested it again. It's working. Looks like the slider only doesn't get updated. If the service starts the slider stays off. Screenshot_20230109_201356_Traccar Client

Thank you 🙂👍

drkmtr commented 1 year ago

Hi, I am also affected by this issue on Samsung Galaxy S21 Ultra (Android 13).

Is it possible to get access to the updated APK? (The link expired)

tananaev commented 1 year ago

Just published a new version 6.19 with the fix.

drkmtr commented 1 year ago

Just published a new version 6.19 with the fix.

Brilliant! Thank you!

AlphaDE commented 1 year ago

The slider still does not get updated when turning the service off by shortcut. Log says service stopped.

Version 7.0