iOS critical notification

Hello,

I successfully added an automation that sends critical notifications on my phone, every 20s. Is there a way to stop the notification when clicking on it? Right now I have to drag it down and select stop option.

The notification is set to open an URL on click.

Thanks!

Send a button with the notification, e.g.

  - action: notify.mobile_app_iphone
    data:
      message: "🔥 The {{ trigger.to_state.attributes.friendly_name }} smoke alarm has TRIGGERED!!!"
      data:
        actions:
        - action: "SILENCEALARM"
          title: "Silence"
        push:
          badge: 0
          sound:
            name: default
            critical: 1
            volume: 1.0

And the automation trigger that handles the button press:

- id: f4126080-b92c-46be-8f27-03de9959e044
  alias: 'Push Notify Action Silence'
  triggers:
  - trigger: event
    event_type: mobile_app_notification_action
    event_data:
      actions: SILENCEALARM
  actions:
    action: etc...

How you do that depends on how you are repeating the message every 20s.

This is what I have now:

alias: changedetection_alarm
description: changedetection
triggers:
  - trigger: persistent_notification
    update_type:
      - added
    notification_id: changedetection
conditions: []
actions:
  - repeat:
      until:
        - condition: template
          value_template: "{{ wait.trigger is not none }}"
      sequence:
        - action: notify.mobile_app_sahara
          data:
            title: STOCK ALERT
            message: "{{ trigger.notification.message }}"
            data:
              tag: stock-alert-loop
              url: "{{ trigger.notification.message }}"
              push:
                interruption-level: critical
                sound:
                  name: default
                  critical: 1
                  volume: 1
              actions:
                - action: STOP_AND_OPEN
                  title: View Item & Stop Alarm
                  uri: "{{ trigger.notification.message }}"
                  destructive: false
        - wait_for_trigger:
            - event_type: mobile_app_notification_action
              event_data:
                action: STOP_AND_OPEN
              trigger: event
          timeout: "00:00:20"
          continue_on_timeout: true
mode: restart

This only stops the alarm if I drag on the notification and select

View Item & Stop Alarm