AutoNotification Inline reply does not work when replied within Android Wear

Discussion in 'AutoApps' started by kenneths, Feb 10, 2018.

  1. kenneths

    kenneths New Member

    Joined:
    Feb 10, 2018
    Messages:
    4
    Likes Received:
    0
    I have a problem when using the app. I cannot get the content of the reply action when replied through an android wear device.

    Step to reproduce:

    Go to tasker, create a new task and give it whatever name. Create a new action -> Plugin -> AutoNotification
    Set the Reply Action to e.g. "testreply" and the text and reply label to something meaningful.

    Then, add a profile -> Event -> AutoNotification -> Plugin -> AutoNotification
    Set the command filter to "testreply"
    For the task associated to the event, do something that display the result. For example, show a popup that displays %anmessage.

    Start the task showing the notification, first reply from phone.
    %anmessage is correctly assigned to "testreply=:=your reply here"

    Now reply from the android wear, %anmessage is assigned to "testreply" only. Therefore, the content of the reply is lost.

    It's my wish to have a tasker workflow that will allow me to input something both from the watch and the phone, so I do hope that you can take a closer look and fix the bug. Thank you very much!
     
  2. kenneths

    kenneths New Member

    Joined:
    Feb 10, 2018
    Messages:
    4
    Likes Received:
    0
    Here is the exception that I get from logcat when something is replied from android wear. Seems like a casting error as SpannableString is not a String but it is a CharSequence.

    02-11 21:48:05.116 10804-10804/? W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String
    at android.os.BaseBundle.getString(BaseBundle.java:1089)
    at com.joaomgcd.autonotification.service.ServiceTaskerCommand.onStartCommand(SourceFile:52)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3722)
    at android.app.ActivityThread.-wrap20(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1767)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:180)
    at android.app.ActivityThread.main(ActivityThread.java:6950)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:835)


    I'm also an Android developer and I hope this makes it trivial to fix the issue. I'm using AN exactly for this purpose only. I do wish that you acknowledge it before my trial period of AN expires. If not, I might have no choice but to put a 1-star rating on Play Store. Thank you.
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi there! Interesting that in all this time no one has ever reported this bug before :)

    Here's a fixed version. Hope this helps!
     
  4. kenneths

    kenneths New Member

    Joined:
    Feb 10, 2018
    Messages:
    4
    Likes Received:
    0
    Sorry to be a little bit harsh. Thanks for your reply and your attempt for the fix.
    However, I still see the same exception in logcat just after replying from the android wear, and the content of the reply is still missing from the variable.
    But the line number from the logcat is different this time. So I believe you have at least made some changes:

    02-12 20:46:16.044 25795-25795/? W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String
    at android.os.BaseBundle.getString(BaseBundle.java:1089)
    at com.joaomgcd.autonotification.service.ServiceTaskerCommand.onStartCommand(SourceFile:46)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3722)
    at android.app.ActivityThread.-wrap20(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1767)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:180)
    at android.app.ActivityThread.main(ActivityThread.java:6950)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:835)


    Maybe you'd like to look again closely for a further fix? Thanks again.
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
  6. kenneths

    kenneths New Member

    Joined:
    Feb 10, 2018
    Messages:
    4
    Likes Received:
    0
    Yep this version works! Thanks a lot mate!!! Will definitely make a purchase for your great work.
     
: bug

Share This Page