AutoNotification Tasker guide for manually implementing new Gmail features in AN

Discussion in 'AutoApps' started by ejf071189, Dec 24, 2017.

  1. ejf071189

    ejf071189 Member

    Joined:
    Jan 18, 2017
    Messages:
    32
    Likes Received:
    0
    Is everything that's happening with the custom gmail notifications feasible through the AN plugin in Tasker? I'd like to do a similar project with notifications from other applications.

    Most notably, I've always had trouble intercepting/replacing notifications in such a way that they get bundled together. I noticed the "mark as read" AN functionality that came out didn't bundle notifications, so thought this was a limitation of AN, but now see that the new update bundles! Would definitely like to see how this works on the back end so I can bundle my replaced notifications from other messaging apps!

    https://joaoapps.com/fully-costumize-buttons-in-gmail-notifications-with-autonotification/
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

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

    ejf071189 Member

    Joined:
    Jan 18, 2017
    Messages:
    32
    Likes Received:
    0
    Ok so I got the bundling working but the other issue I was having (and still am) is to get the notifications to append update (I'm replacing notifications from the android messages app per this guide: http://forum.joaoapps.com/index.php?resources/replace-third-party-notificatios-with-your-own.262/)

    I tried making the initial notification using the notification title (the sender of the message) as the notification ID as well as a hardcoded value (e.g. 555) for testing, and in both cases get the error: "Notification can't be updated because no notification with the same ID exists"

    Does the ID of the notification have the potential to change? If so, what could I be doing that's changing it?

    Also, when I use the "pull from existing notification" feature in the AN intercept event profile, it pulls completely different IDs than what I specify when the notifications are created, but even when I put this id into an update notification, I still get the above error.

    EDIT: I was able to find here that the last paragraph is explained by string>integer conversion: plus.google.com/104234830799379436791/posts/N2cYPwJAm7c
     
    Last edited: Jan 13, 2018
  4. ejf071189

    ejf071189 Member

    Joined:
    Jan 18, 2017
    Messages:
    32
    Likes Received:
    0
    Oddly enough, the notifications can be canceled using the AN cancel action using the IDs with which they are created.
     
  5. ejf071189

    ejf071189 Member

    Joined:
    Jan 18, 2017
    Messages:
    32
    Likes Received:
    0
    After further testing, I was able to find that the reply action is what's causing the problem. If a notification has a reply action associated with it, then trying to update it results in the "no notification with the same ID exists" error, though canceling it works just fine with the ID.
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You don't need to update it though :) Just create a new notification with the same id and it'll overwrite the previous one.
     
  7. ejf071189

    ejf071189 Member

    Joined:
    Jan 18, 2017
    Messages:
    32
    Likes Received:
    0
    But when I do that the notification would only show the most recent message as opposed to the last couple. i.e. if someone says (Message 1) "Hey!" (Message 2) "What's up?" The messages app puts both of those into one notification (by updating the first notification with the new text). I suppose a workaround would be to query the old notification and extract the text, then build the text of the new notification by combining them.
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yeah, that would be a way to do it, you're right.
     

Share This Page