Documentation ¶
Overview ¶
Package pushwoosh provides functions and structs for accessing the Pushwoosh Remote API.
Index ¶
Constants ¶
const ( DeviceTypeIOS = 1 DeviceTypeBB = 2 DeviceTypeAndroid = 3 DeviceTypeWindowsPhone = 5 DeviceTypeOSX = 7 DeviceTypeWindows = 8 DeviceTypeAmazon = 9 DeviceTypeSafari = 10 DeviceTypeChrome = 11 DeviceTypeFirefox = 12 )
Possible device types
Variables ¶
This section is empty.
Functions ¶
func SetHTTPClient ¶
SetHTTPClient overrides the default HTTP client.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an API client for Pushwoosh.
func (*Client) CreateMessage ¶
CreateMessage creates a new push message. http://docs.pushwoosh.com/docs/createmessage
func (*Client) DeregisterDevice ¶ added in v0.1.3
DeregisterDevice removes device from the application. http://docs.pushwoosh.com/docs/unregisterdevice
func (*Client) RegisterDevice ¶
RegisterDevice registers device for the application. http://docs.pushwoosh.com/docs/registerdevice
type Device ¶
type Device struct { Type int64 `json:"device_type"` PushToken string `json:"push_token"` HardWareID string `json:"hwid"` Language string `json:"language,omitempty"` Timezone int64 `json:"timezone,omitempty"` }
Device is a struct to register device.
type Message ¶
type Message struct { Content string `json:"content"` SendDate string `json:"send_date,omitempty"` Devices []string `json:"devices,omitempty"` Users []string `json:"users,omitempty"` Data map[string]interface{} `json:"data,omitempty"` // key/value pair Campaign string `json:"campaign,omitempty"` TimeZone string `json:"timezone,omitempty"` IgnoreUserTimezone bool `json:"ignore_user_timezone,omitempty"` Platforms []int64 `json:"platforms,omitempty"` Preset string `json:"preset,omitempty"` SendRate int64 `json:"send_rate,omitempty"` // iOS related IOSBadges string `json:"ios_badges,omitempty"` // integer or use "+n" or "-n" to increment/decrement the badge value by n // Android related AndroidBadges string `json:"android_badges,omitempty"` // integer or use "+n" or "-n" to increment/decrement the badge value by n }
Message is a struct to create messages.
type ResponseMessages ¶ added in v0.1.1
type ResponseMessages struct { Messages []string `json:"Messages"` UnknownDevices map[string][]string `json:"UnknownDevices"` }
ResponseMessages represents messages from Pushwoosh API
type Result ¶
type Result struct { StatusCode int64 `json:"status_code"` StatusMessage string `json:"status_message"` Response ResponseMessages `json:"response"` }
Result represents API Response for Pushwoosh.