AutoNotification Problems Related to Google Reminders

Discussion in 'AutoApps' started by NickB, Jul 1, 2019.

  1. NickB

    NickB New Member

    Joined:
    Mar 27, 2017
    Messages:
    10
    Likes Received:
    1
    Hello,
    I own a Pebble watch and I'd like to get the Google Reminders on it. For whatever reason Google marked the notifications that come out of the, "Google" app for reminders as, "don't send to wear device," so I don't get them on my Pebble. I've setup an AutoNotification event to intercept them, but I'm experiencing two problems:
    1. The notification is not intercepted; that is to say that the official Google notification remains along side of the AutoNotification one.
    2. The button actions do not appear to work. I wasn't sure if I had to implement the AutoNotification commands for them somehow though.

    Here is my profile export:
    Code (Text):

        Profile: Rebroadcast Google Reminder (126)
            Event: AutoNotification Intercept [
                Configuration:Event Behaviour: true
                Notification Type: Only Created Notifications
                Notification Apps: Google
                Get All Fields : true
             ]
        Enter: Anon (127)
            A1: If [ %anstatusbaricon Set ]
            A2: AutoNotification [
                Configuration:Title: Reminder: %antitle
                Text: %antext
                Ticker: %anticker
                Icon: %anicon
                Status Bar Icon Manual: %anstatusbaricon
                Status Bar Text Size: 16
                Visibility: Public
                SubText: %ansubtext
                Time: %anwhentime
                Title Expanded: Reminder: %antitlebig
                Text Expanded: %antextbig
                Button 1: %anbutton1action
                Label 1: %anbutton1text
                Action Icon 1 Manual: %anbutton1icon
                Button 2: %anbutton2action
                Label 2: %anbutton2text
                Action Icon 2 Manual: %anbutton2icon
                Icon 3: ic_launcher
                Timeout (Seconds):20
            ] If [ %anbutton2text eq Done | %anbutton1text eq Done ]
            A3: End If
     
    Last edited: Jul 2, 2019
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I think this will explain how you can get it working :)
     
  3. NickB

    NickB New Member

    Joined:
    Mar 27, 2017
    Messages:
    10
    Likes Received:
    1
    Thanks for the reply João. I haven't tested the profile out yet, but at first glance it seems it only solves problem #2 I mentioned. For problem #1, if the event is setup to intercept the app's notifications, shouldn't the notification not appear from the originating app? Currently with the interception profile I posted above, the original notification still appears side-by-side with the AutoNotification notification.

    I thought about cancelling the notification after intercepting it, but wouldn't that make the action IDs associated with the notifications no longer work?

    Thanks again, --Nick
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    That's the first part of the linked project :) First you block the messages then you intercept them. If you don't wish to block them you can cancel them like you mentioned. On most apps actions will continue working normally :)
     
  5. NickB

    NickB New Member

    Joined:
    Mar 27, 2017
    Messages:
    10
    Likes Received:
    1
    I've managed to suppress the original notification using the Whatsapp example, but the actions don't work. I setup the following profiles to aid in specifically invoking the action associated with the button press:
    Code (Text):

        Profile: Rebroadcast Google Reminder (126)
           Event: AutoNotification Intercept [ Configuration:Event Behaviour: true
        Notification Type: Only Created Notifications
        Notification Apps: Google
        Get All Fields : true ]
        Enter: Rebroadcast GMinder (127)
           <Build up to 5 custom buttons...>
           A1: For [ Variable:%idx Items:1,2,3,4,5 ]
           <... For, 'text' and, 'action'...>
           A2: For [ Variable:%tag Items:text,action ]
           A3: Variable Set [ Name:%varname To:anbutton Recurse Variables:Off Do Maths:Off Append:Off ]
           A4: Variable Set [ Name:%varname To:%idx Recurse Variables:Off Do Maths:Off Append:On ]
           A5: Variable Set [ Name:%varname To:%tag Recurse Variables:Off Do Maths:Off Append:On ]
           <Is '%button#text' or '%button#action' set? (where '#' is %idx)>
           A6: If [ %%varname Set ]
           <... Yup! Then build a new custom variable...>
           A7: Variable Set [ Name:%newvarname To:button Recurse Variables:Off Do Maths:Off Append:Off ]
           A8: Variable Set [ Name:%newvarname To:%idx Recurse Variables:Off Do Maths:Off Append:On ]
           A9: Variable Set [ Name:%newvarname To:%tag Recurse Variables:Off Do Maths:Off Append:On ]
           <Is this an action?>
           A10: If [ %tag eq action ]
           <...Yup! So high-jack the existing action to use in AutoApps...>
           A11: Variable Set [ Name:%%newvarname To:notificationaction=:= Recurse Variables:Off Do Maths:Off Append:Off ]
           A12: Variable Set [ Name:%%newvarname To:%anpackage Recurse Variables:Off Do Maths:Off Append:On ]
           A13: Variable Set [ Name:%%newvarname To:=:= Recurse Variables:Off Do Maths:Off Append:On ]
           A14: Variable Set [ Name:%%newvarname To:%anid Recurse Variables:Off Do Maths:Off Append:On ]
           <[Final piece appended below...]>
           A15: Variable Set [ Name:%%newvarname To:=:= Recurse Variables:Off Do Maths:Off Append:On ]
           A16: End If
           <Finalize the contents whether, 'action' or, 'text.'>
           A17: Variable Set [ Name:%%newvarname To:%%varname Recurse Variables:Off Do Maths:Off Append:On ]
           <Keep track of how many actions we found.>
           A18: Variable Set [ Name:%lastIdx To:%idx Recurse Variables:Off Do Maths:Off Append:Off ]
           <%%varname not found>
           A19: Else
           A20: End If
           <Delete lastIdx if 1>
           A21: Variable Clear [ Name:%lastIdx Pattern Matching:Off Local Variables Only:Off ] If [ %lastIdx eq 1 ]
           A22: End For
           A23: End For
           <5 buttons>
           A24: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Button 1: %button1action
        Label 1: %button1text
        Action Icon 1 Manual: %anbutton1icon
        Button 2: %button2action
        Label 2: %button2text
        Action Icon 2 Manual: %anbutton2icon
        Button 3: %button3action
        Label 3: %button3text
        Action Icon 3 Manual: %anbutton3icon
        Button 4: %anbutton4action
        Action Icon 4 Manual: %anbutton4icon
        Button 5: %button5action
        Action Icon 5 Manual: %anbutton5icon Timeout (Seconds):20 ] If [ %lastIdx eq 5 ]
           <4 buttons>
           A25: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Button 1: %button1action
        Label 1: %button1text
        Action Icon 1 Manual: %anbutton1icon
        Button 2: %button2action
        Label 2: %button2text
        Action Icon 2 Manual: %anbutton2icon
        Button 3: %button3action
        Label 3: %button3text
        Action Icon 3 Manual: %anbutton3icon
        Button 4: %anbutton4action
        Action Icon 4 Manual: %anbutton4icon
        Icon 5: ic_launcher Timeout (Seconds):20 ] If [ %lastIdx eq 4 ]
           <3 buttons>
           A26: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Button 1: %button1action
        Label 1: %button1text
        Action Icon 1 Manual: %anbutton1icon
        Button 2: %button2action
        Label 2: %button2text
        Action Icon 2 Manual: %anbutton2icon
        Button 3: %button3action
        Label 3: %button3text
        Action Icon 3 Manual: %anbutton3icon Timeout (Seconds):20 ] If [ %lastIdx eq 3 ]
           <2 buttons>
           A27: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Button 1: %button1action
        Label 1: %button1text
        Action Icon 1 Manual: %anbutton1icon
        Button 2: %button2action
        Label 2: %button2text
        Action Icon 2 Manual: %anbutton2icon
        Icon 3: ic_launcher
        Icon 4: ic_launcher
        Icon 5: ic_launcher Timeout (Seconds):20 ] If [ %lastIdx eq 2 ]
           <1 buttons>
           A28: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Button 1: %button1action
        Label 1: %button1text
        Action Icon 1 Manual: %anbutton1icon
        Icon 3: ic_launcher Timeout (Seconds):20 ] If [ %lastIdx eq 1 ]
           <No buttons>
           A29: AutoNotification [ Configuration:Title: Reminder: %antitle
        Text: %antext
        Ticker: %anticker
        Icon: %anicon
        Status Bar Icon Manual: %anstatusbaricon
        Status Bar Text Size: 16
        Visibility: Public
        SubText: %ansubtext
        Time: %anwhentime
        Title Expanded: Reminder: %antitlebig
        Text Expanded: %antextbig
        Separator: ,
        Icon 3: ic_launcher Timeout (Seconds):20 ] If [ %lastIdx !Set | %lastIdx < 1 ]
           A30: [X] Popup [ Title: Text:LastIdx: %lastIdx
        Action 1: %button1text: %button1action Background Image: Layout:Popup Timeout (Seconds):600 Show Over Keyguard:On ]
       
        Profile: Reply Notification (90)
           Event: AutoApps Command [ Configuration:Command Filter: notificationaction=:=
        Variable Names: packagename,notificationid,actionid ]
        Enter: Anon (89)
           A1: AutoNotification Actions [ Configuration:Package Name: %packagename (exact)
        Intercept Action ID: %actionid Timeout (Seconds):20 ]
           A2: AutoNotification Cancel [ Configuration:Id: %notificationid Timeout (Seconds):0 ]
     
    But in the end, the actions still do nothing. While yes, it removes the notification, looking at Google Calendar, the reminders don't have any action taken on them.

    Honestly I'm thinking that there's some funny-business happening, perhaps such as one other Google app (say, Google Calendar) emitting the reminder notification and the, "Google" app intercepting and rebroadcast in it which is why all of these pains (including not coming to my watch to start with) are happening.

    Do you have any debug tools to track the life cycle of the notification, or at least a reminder in Android? I might have to redirect the action to a different package to make it take effect and it would be nice to know which package that might be.

    Thanks! --Nick
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you check what command is sent when you click on an action button? You can check in the AutoApps logs. Thanks.
     
  7. NickB

    NickB New Member

    Joined:
    Mar 27, 2017
    Messages:
    10
    Likes Received:
    1
    @joaomgcd The command is properly structured and valid. I debugged the action ID coming across and it is a valid action GUID, but nothing happens when calling AutoNotification Action with it. If you create a reminder, do you get the same behavior? You can import my profiles to test, but you'll have to change the notification ID it targets since I'm discovering the IDs are randomly changed at times.

    But aside from the toast I used to debug the action ID, here is the log entry in AutoApp:

    Code (Text):
    New Last Command: notificationaction=:=com.google.android.googlequicksearchbox=:=-1023633255=:=c6b38ea7-9768-4561-b420-32b368c91e41;
    Also -- in regards to my feature request I sent by email -- this is a good example of a situation that's impossible to accurately target, intercept, and block without Notification Categories being part of both AN Block and AN Intercept. That is to say, AN Block can only target by App, Text, Title, Priority, and ID. None of these are unique enough to be able to accurately target Google Reminders without capturing other 'Google' (app) categories like News. For now it's simply targeting everything coming out of the Google app, which is not ideal, but will be acceptable to live with if I can get the other problem resolved.
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Does it work if you don't delete the other app's notification? Maybe that specific app makes the actions not work as soon as the notification is removed?
     
  9. NickB

    NickB New Member

    Joined:
    Mar 27, 2017
    Messages:
    10
    Likes Received:
    1
    @joaomgcd Thought of that already :) Unfortunately the action doesn't work regardless of whether the original notification is canceled or not.

    For now I've decided on sending a notification to my Pebble using a custom Task that sends an intent to the Pebble app like so:
    Code (Text):
    Send Pebble Notification (66)
       A1: Send Intent [
          Action:com.getpebble.action.SEND_NOTIFICATION
          Cat:None
          Mime Type:
          Data:
          Extra:messageType:PEBBLE_ALERT
          Extra:sender:Tasker
          Extra:notificationData:[ { "title":"%par1","body":"%par2"} ]
          Package:
          Class:
          Target:Broadcast Receiver
       ]
    Obviously then the Done / 1 Hour actions aren't available, but they never would have been anyway since AutoNotification doesn't use or have an option for NotificationCompat :)
     
    Last edited: Jul 24, 2019

Share This Page