README.md in pushpad-0.7.0 vs README.md in pushpad-0.8.0
- old
+ new
@@ -85,21 +85,24 @@
icon_url: "http://example.com/assets/icon.png", # optional, defaults to the project icon
image_url: "http://example.com/assets/image.png", # optional, an image to display in the notification content
ttl: 604800, # optional, drop the notification after this number of seconds if a device is offline
require_interaction: true, # optional, prevent Chrome on desktop from automatically closing the notification after a few seconds
custom_data: "123", # optional, a string that is passed as an argument to action button callbacks
- // optional, add some action buttons to the notification
- // see https://pushpad.xyz/docs/action_buttons
+ # optional, add some action buttons to the notification
+ # see https://pushpad.xyz/docs/action_buttons
actions: [
{
title: "My Button 1", # max length is 20 characters
target_url: "http://example.com/button-link", # optional
icon: "http://example.com/assets/button-icon.png", # optional
action: "myActionName" # optional
}
],
- starred: true # optional, bookmark the notification in the Pushpad dashboard (e.g. to highlight manual notifications)
+ starred: true, # optional, bookmark the notification in the Pushpad dashboard (e.g. to highlight manual notifications)
+ # optional, use this option only if you need to create scheduled notifications (max 5 days)
+ # see https://pushpad.xyz/docs/schedule_notifications
+ send_at: Time.utc(2016, 7, 25, 10, 9)
})
# deliver to a user
notification.deliver_to user # or user_id
@@ -130,9 +133,10 @@
The methods above return an hash:
- `"id"` is the id of the notification on Pushpad
- `"scheduled"` is the estimated reach of the notification (i.e. the number of devices to which the notification will be sent, which can be different from the number of users, since a user may receive notifications on multiple devices)
- `"uids"` (`deliver_to` only) are the user IDs that will be actually reached by the notification because they are subscribed to your notifications. For example if you send a notification to `['uid1', 'uid2', 'uid3']`, but only `'uid1'` is subscribed, you will get `['uid1']` in response. Note that if a user has unsubscribed after the last notification sent to him, he may still be reported for one time as subscribed (this is due to [the way](http://blog.pushpad.xyz/2016/05/the-push-api-and-its-wild-unsubscription-mechanism/) the W3C Push API works).
+- `"send_at"` is present only for scheduled notifications. The fields `"scheduled"` and `"uids"` are not available in this case.
The `id` and `scheduled_count` attribute are also stored on the notification object:
```ruby