class Dirigible::Push
Public Class Methods
create(params)
click to toggle source
Send a push notification to a specified device or list of devices. Must be one of:
-
A single {docs.urbanairship.com/reference/api/v3/push.html#push-object
Push
Object} -
An array of one or more {docs.urbanairship.com/reference/api/v3/push.html#push-object
Push
Object}
@example Example request:
Dirigible::Push.create({ audience: { device_token: "998BAD77A8347EFE7920F5367A4811C4385D526AE42C598A629A73B94EEDBAC8" }, notification: { alert: "Hello!" }, device_types: "all" })
@see docs.urbanairship.com/reference/api/v3/push.html#push
# File lib/dirigible/push.rb, line 17 def self.create(params) Dirigible.post('/push', params) end
validate(params)
click to toggle source
Accept the same range of payloads as /api/push, but parse and validate only, without sending any pushes.
@example Missing payload:
Dirigible::Push.validate({ audience: "all", device_types: ["ios", "android"], notification: { ios: { alert: "Boo" } } })
@example Device identifier/restriction mismatch:
Dirigible::Push.validate({ audience: { or: [ device_pin: "1fd34210", device_token: "645A5C6C06AFB2AE095B079135168A04A5F974FBF27163F3EC6FE1F2D5AFE008" ] }, device_types: ["blackberry"], notification: { alert: "WAT" } })
@see docs.urbanairship.com/reference/api/v3/push.html#validate
# File lib/dirigible/push.rb, line 48 def self.validate(params) Dirigible.post('/push/validate', params) end