AutoNotification Get Notification Id on button press

Discussion in 'AutoApps' started by TopCat, Apr 3, 2018.

  1. TopCat

    TopCat New Member

    Joined:
    Mar 30, 2018
    Messages:
    3
    Likes Received:
    0
    I've been using AutoNotification for a week or two now and I've set up a few notifications with buttons and the Tasker profile to action the buttons all work fine. I'd like to be able to expand one of these but I need the ID for the notification on which the button was pressed. This piece of data doesnt seem to be available when AutoNotification is used in the profile (unlike with Interception).

    My use case is to be able to extend the length of time I'm in a meeting when it overruns. I'd like to be able to update the notification to show it has been extended for which I believe i need %anid.

    How could a query action bring back the correct notification esp. if there is more than one with those buttons enabled?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You should add the id as part of the button's command :) There's no other way to get it, sorry!
     
  3. TopCat

    TopCat New Member

    Joined:
    Mar 30, 2018
    Messages:
    3
    Likes Received:
    0
    So where my button action is:
    ANAction Meeting=:=Extend 15
    Then I would need to add %anid to the end.
    Is that correct?
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Not exactly %anid but the value you used in the ID field for the notification! You could make it

    ANAction Meeting=:=Extend 15=:=myid
     
  5. Tasker Pro

    Tasker Pro New Member

    Joined:
    Jul 27, 2016
    Messages:
    22
    Likes Received:
    4
    When using an AutoNotification Query action - an %anid is indeed returned (but it's not the one originally user assigned at its creation). Can this %anid from the Query action be used to update the notification? Or does it have to be the original user-assigned one?

    Because I think when using something like the AN Cancel action - either ID can be used? (could cancel "myid" or the Query-returned "1435645")?
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    The original isn't stored anywhere unfortunatelyl. The problem is that Android requires IDs to be Ints. To make it more user friendly I made users use Strings instead and then I convert those to numbers.

    When cancelling AutoNotification notifications you should use strings, when cancelling third party you should use numbers. Hope this clarifies it!
     
  7. Tasker Pro

    Tasker Pro New Member

    Joined:
    Jul 27, 2016
    Messages:
    22
    Likes Received:
    4
    Makes sense!
     
: button press

Share This Page