看看这个能不能参考
alias: 给iphone发消息
sequence:
- alias: Set up variables
variables:
action_confirm: "{{ 'CONFIRM_' ~ context.id }}"
action_dismiss: "{{ 'DISMISS_' ~ context.id }}"
notification_title: "{{ title }}"
notification_message: "{{ message }}"
- alias: Send notification
domain: mobile_app
type: notify
device_id: bc3980f01c18ded90bea32c3eab17ef8
title: "{{ notification_title }}"
message: "{{ notification_message }}"
data:
actions:
- action: "{{ action_confirm }}"
title: 确认
- action: "{{ action_dismiss }}"
title: 忽略
- alias: Awaiting response
wait_for_trigger:
- event_type: mobile_app_notification_action
event_data:
action: "{{ action_confirm }}"
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: "{{ action_dismiss }}"
trigger: event
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == action_confirm }}"
sequence: []
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == action_dismiss }}"
sequence: []
description: ""
|