Documentation ¶
Index ¶
- Constants
- type APIError
- type Actions
- type AndroidOverride
- type AndroidStyle
- type AtomicSelector
- type AudienceSelector
- type Auth
- type Campaigns
- type Client
- type CompoundSelector
- type ErrorDetails
- type ErrorResponse
- type IOSMediaAttachment
- type IOSOverride
- type MessageCenterObject
- type NotificationObject
- type OpenAction
- type OpenDeepLinkAction
- type Options
- type PushObject
- type PushResponse
- type Time
Constants ¶
const ( NorthAmerica = "https://go.urbanairship.com" Europe = "https://go.airship.eu" )
Airship API base URLs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { StatusCode int Response *ErrorResponse RawBody []byte }
APIError represents an Airship API error. When possible, the response will be parsed into the Response field.
type AndroidOverride ¶
type AndroidOverride struct { Style *AndroidStyle `json:"style,omitempty"` Title string `json:"title,omitempty"` }
AndroidOverride data format
type AndroidStyle ¶
type AndroidStyle struct { BigPicture string `json:"big_picture,omitempty"` Type string `json:"type,omitempty"` }
AndroidStyle is the representation of Android advanced styles.
type AtomicSelector ¶
type AtomicSelector struct { AudienceSelector `json:"-"` NamedUser []string `json:"named_user,omitempty"` Tag []string `json:"tag,omitempty"` }
AtomicSelector data format
type Auth ¶
type Auth func(*Client)
Auth represents the API authentication method.
func BearerAuth ¶
BearerAuth is the HTTP Bearer token authentication method.
type Campaigns ¶
type Campaigns struct {
Categories []string `json:"categories,omitempty"`
}
Campaigns data format
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the Airship API.
func (*Client) Push ¶
func (c *Client) Push(ctx context.Context, objects []PushObject) (*PushResponse, error)
Push is POST /api/push
type CompoundSelector ¶
type CompoundSelector struct { AudienceSelector `json:"-"` And []AudienceSelector `json:"AND,omitempty"` }
CompoundSelector data format
type ErrorDetails ¶
type ErrorDetails struct { Error string `json:"error"` Location struct { Line int `json:"line"` Column int `json:"column"` } `json:"location"` Path string `json:"path"` }
ErrorDetails data format
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` ErrorCode int `json:"error_code"` Details ErrorDetails `json:"details"` }
ErrorResponse data format
type IOSMediaAttachment ¶
type IOSMediaAttachment struct {
URL string `json:"url,omitempty"`
}
IOSMediaAttachment is the representation of media attachments (>= iOS 10).
type IOSOverride ¶
type IOSOverride struct { MediaAttachment *IOSMediaAttachment `json:"media_attachment,omitempty"` Title string `json:"title,omitempty"` }
IOSOverride data format
type MessageCenterObject ¶
type MessageCenterObject struct { Body string `json:"body,omitempty"` ContentType string `json:"content_type,omitempty"` Expiry *Time `json:"expiry,omitempty"` Extra map[string]string `json:"extra,omitempty"` Title string `json:"title,omitempty"` }
MessageCenterObject data format
type NotificationObject ¶
type NotificationObject struct { Actions *Actions `json:"actions,omitempty"` Alert string `json:"alert,omitempty"` Android *AndroidOverride `json:"android,omitempty"` IOS *IOSOverride `json:"ios,omitempty"` }
NotificationObject data format
type OpenDeepLinkAction ¶
type OpenDeepLinkAction struct { OpenAction `json:"-"` Content string `json:"content,omitempty"` Type string `json:"type,omitempty"` }
OpenDeepLinkAction data format
type PushObject ¶
type PushObject struct { Audience AudienceSelector `json:"audience,omitempty"` Campaigns *Campaigns `json:"campaigns,omitempty"` DeviceTypes []string `json:"device_types,omitempty"` Message *MessageCenterObject `json:"message,omitempty"` Notification *NotificationObject `json:"notification,omitempty"` Options *Options `json:"options,omitempty"` }
PushObject data format
type PushResponse ¶
type PushResponse struct { OK bool `json:"ok"` OperationID string `json:"operation_id"` PushIDs []string `json:"push_ids"` }
PushResponse is the response format for POST /api/push