How-Notifications-Work.md
1. Pre-define notification categories which contain 1-4 actions.
1. Notify iOS app with `data.push.category` set to `ALARM` (which contains actions named `SOUND_ALARM` and `SILENCE_ALARM`).
2. Push notification delivered to device
3. `SOUND_ALARM` button on notification pressed
4. Identifier of button (`SOUND_ALARM`) sent back to HA as the `actionName` property of the event `ios.notification_action_fired`.
configuration.yaml
ios:
push_categories: # Defines actionable notifications. Categories are groups of actions. You specify the category in the notification.
- name: Alarm
identifier: 'ALARM' # Must be unique and ALL CAPS
actions:
- identifier: 'SOUND_ALARM' # Must be unique and ALL CAPS
title: 'Sound Alarm' # Needs to be short!
activationMode: 'background' # or background. The mode in which to run the app when the action is performed.
authenticationRequired: yes # A Boolean value indicating whether the user must unlock the device before the action is performed.
destructive: yes # A Boolean value indicating whether the action is destructive. When the value of this property is true, the system displays the corresponding button differently to indicate that the action is destructive.
This file has been truncated. show original
ios.py
"""
Native Home Assistant iOS app component. Should be put into ~/.homeassistant/custom_components/ios.py.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/ios/
"""
import os
import json
import logging
import requests
This file has been truncated. show original
There are more than three files. show original