Zac West 1b88de68a6
Dynamic, per-notification actions (#1588)
Depends on home-assistant/mobile-apps-fcm-push#47 which allows the actions to be included in the notification data, and also on-the-fly silently sets the category to `DYNAMIC` which this requires.

## Summary
Allows for specifying the actions for a notification on-the-fly without defining a category. This should allow us to make all of the category config and setup unnecessary, so I'll probably consider marking it as deprecated in this release.

## Screenshots

For a notification that looks like…

```yaml
service: notify.mobile_app_iphone
data:
  title: title here
  message: body here
  data: 
    actions:
    - action: "id1"
      title: "id1 title"
      # this mirrors the action definition in yaml now, it just _also_ supports what android 
    - identifier: "id2"
      title: "id2 title"
```

![Simulator Screen Shot - Apple Watch Series 6 - 40mm - 2021-04-17 at 20 54 33](https://user-images.githubusercontent.com/74188/115135570-5b5f8c80-9fce-11eb-9118-0d156578d9e5.png)
![Simulator Screen Shot - iPhone 12 Pro - 2021-04-17 at 22 41 07](https://user-images.githubusercontent.com/74188/115135572-60bcd700-9fce-11eb-81b6-c908da8e204c.png)

## Link to pull request in Documentation repository
- Documentation: home-assistant/companion.home-assistant#496

## Any other notes
- Dynamic actions are visual - we provide custom UI on both iOS and watchOS for the additional actions, which does require we run the app on the given platform; for example, this doesn't yet work on macOS [I need to figure out how to make Catalyst notification content work, if it is] and if you uninstall the watch app these actions will not show up.
- Allows `map` and `camera`-esque notification content on any category. In other words, if you send a notification with `map` it'll still prefer the camera `entity_id` if present. This is largely to continue in the direction of making category deprecated; as long as the content extension launches, it'll figure out what to display.

All of the normal action configuration is allowed in these actions:
- action or identifier
- title
- authenticationRequired (default: false)
- behavior (default: default, aka not textinput)
- activationMode (default: background)
- destructive (default: false)
- textInputButtonTitle (default: nil)
- textInputPlaceholder (default: nil)

Some additional things occur to match existing Android functionality:
- `uri` (or `url`) being provided in the action makes it a 'foreground' action
- action/identifier of `REPLY` changes the behavior to textinput
- `mobile_app_notification_action` is now fired with data that looks like theirs:

```
Sending action: mobile_app_notification_action
payload: ["action": "REPLY", "reply_text": "Reply text"]
```

and

```
Sending action: mobile_app_notification_action
payload: ["action": "id1"]
```
2021-04-19 04:28:39 +00:00
..