Alok Saboo 8ec4d8d172 Added group (iOS) notification instructions (#2523)
* Updated apiai logo

* Updated Api.ai logo

The current logo was not visible against our white background (on the
components page) or the gray background (elsewhere on the website).

* Added group notifications instructions

Added instructions for sending notifications to multiple phones

* Link notification group
2017-04-28 09:35:33 +02:00

2.4 KiB

layout, title, description, date, sidebar, comments, sharing, footer, redirect_from
layout title description date sidebar comments sharing footer redirect_from
page Basic Notifications Basic notes about iOS notifications 2016-10-25 15:00:00 -0700 true false true true /ecosystem/ios/notifications/basic/

The iOS notify platform accepts the standard title, message and target parameters. The iOS notify platform supports targets as services. Assuming that you did not set a name when configuring the platform you should find all your registered and notification-enabled iOS devices available as notify targets as services with names prefixed "notify.ios_" and then the device name you entered at setup.

Notes:

  • title only displays on Apple Watch and iOS 10 devices.

  • target can be used to specific a single device using its PushID, found in ios.conf. The preferred way of providing a target is through a target specific notify service.

A push notification showing all of the basic options `title` and `message` as well as `subtitle` and [actions](/ecosystem/ios/notifications/actions/).

{% linkable_title Enhancing basic notifications %}

Badge

You can set the icon badge in the payload:

automation:
  - alias: Notify iOS app
    trigger:
      ...
    action:
      service: notify.ios_<your_device_id_here>
      data:
        message: "Something happened at home!"
        data:
          push:
            badge: 5

Subtitle

iOS 10 supports a subtitle in addition to the title:

automation
  - alias: Notify iOS app
    trigger:
      ...
    action:
      service: notify.ios_<your_device_id_here>
      data:
        message: "Something happened at home!"
        data:
          subtitle: "Subtitle goes here"

{% linkable_title Sending notifications to multiple phones %}

To send notifications to multiple phones, create a notification group:

notify:
  - name: NOTIFIER_NAME
    platform: group
    services:
      - service: ios_iphone_one
      - service: ios_iphone_two

Now, you can send notifications to everyone in the group using:

  automation:
    - alias: Notify iOS app
      trigger:
        ...
      action:
        service: notify.NOTIFIER_NAME
        data:
          message: "Something happened at home!"
          data:
            push:
              badge: 5