docs/push.rst in urbanairship-4.1.1 vs docs/push.rst in urbanairship-5.0.0
- old
+ new
@@ -57,10 +57,22 @@
.. code-block:: ruby
push.audience = UA.amazon_channel(uuid)
+Select a single Web Channel:
+
+.. code-block:: ruby
+
+ push.audience = UA.channel(uuid)
+
+Select a single Open Channel:
+
+.. code-block:: ruby
+
+ push.audience = UA.open_channel(uuid)
+
Select a single iOS device token:
.. code-block:: ruby
push.audience = UA.device_token(token)
@@ -69,11 +81,11 @@
.. code-block:: ruby
push.audience = UA.apid(uuid)
-Select a single Windows 8 APID:
+Select a single Windows APID:
.. code-block:: ruby
push.audience = UA.wns(uuid)
@@ -202,11 +214,11 @@
ios: UA.ios(
alert: 'Hello iOS!',
badge: 123,
sound: 'sound file',
extra: { 'key' => 'value', 'key2' => 'value2' },
- expiry: '2012-01-01 12:45:00',
+ expiry: '2019-01-01 12:45:00',
category: 'category_name',
interactive: UA.interactive(
type: 'ua_share',
button_actions: {
share: { share: 'Sharing is caring!' }
@@ -224,11 +236,11 @@
push.notification = UA.notification(
alert: 'Hello World!',
amazon: UA.amazon(
alert: 'Hello Amazon!',
consolidation_key: 'key',
- expires_after: '2012-01-01 12:45:00',
+ expires_after: '2019-01-01 12:45:00',
extra: { 'key' => 'value', 'key2' => 'value2' },
title: 'title',
summary: 'summary',
interactive: UA.interactive(
type: 'ua_share',
@@ -258,10 +270,51 @@
}
)
)
)
+**Example Web Override**
+
+.. code-block:: ruby
+
+ push.notification = UA.notification(
+ alert: 'Hello World!',
+ web: UA.web(
+ alert: 'Hello Web!',
+ title: 'My Title',
+ extra: { 'key' => 'value', 'key2' => 'value2' },
+ require_interaction: true,
+ icon: { 'url' => 'https://www.urbanairship.com'}
+ )
+ )
+
+**Example Open Platform Override**
+
+.. code-block:: ruby
+
+ push.notification = UA.notification(
+ alert: 'Hello World!',
+ open_platforms: {
+ 'open::toaster': UA.open_platform(
+ alert: 'Hello Toaster',
+ title: 'My Title',
+ summary: 'My Summary',
+ extra: { 'key' => 'value', 'key2' => 'value2' },
+ media_attachment: 'https://media.giphy.com/media/JYsWwF82EGnpC/giphy.gif',
+ interactive: UA.interactive(
+ type: 'ua_share',
+ button_actions: {
+ share: { share: 'Sharing is caring!' }
+ }
+ )
+ ),
+ 'open::refrigerator': UA.open_platform(
+ alert: 'Hello Fridge'
+ )
+ }
+ )
+
**Example WNS Override**
.. code-block:: ruby
push.notification = UA.notification(
@@ -349,10 +402,10 @@
In addition to specifying the audience, you must specify the device
types you wish to target with a list of strings:
.. code-block:: ruby
- push.device_types = UA.device_types(['ios', 'android'])
+ push.device_types = UA.device_types(['ios', 'android', 'web', 'open::example'])
or with the ``all`` shortcut.
.. code-block:: ruby