traccar-client-android icon indicating copy to clipboard operation
traccar-client-android copied to clipboard

Error creating a shortcut for start or stop service

Open DST73 opened this issue 2 years ago • 12 comments

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):

  • Device: Samsung S20 Ultra
  • OS: Android 13

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

DST73 avatar Jan 09 '23 12:01 DST73

Does the shortcut work manually?

tananaev avatar Jan 09 '23 15:01 tananaev

It works manually if I long press on the icon

DST73 avatar Jan 09 '23 16:01 DST73

Probably related to this:

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

tananaev avatar Jan 09 '23 16:01 tananaev

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

DST73 avatar Jan 09 '23 16:01 DST73

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

tananaev avatar Jan 09 '23 17:01 tananaev

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

DST73 avatar Jan 09 '23 18:01 DST73

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

tananaev avatar Jan 09 '23 18:01 tananaev

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 🙂👍

DST73 avatar Jan 09 '23 19:01 DST73

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)

drkmtr avatar Jan 25 '23 09:01 drkmtr

Just published a new version 6.19 with the fix.

tananaev avatar Jan 25 '23 15:01 tananaev

Just published a new version 6.19 with the fix.

Brilliant! Thank you!

drkmtr avatar Jan 25 '23 23:01 drkmtr

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

Version 7.0

AlphaDE avatar Jul 12 '23 11:07 AlphaDE