Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
APIClient is the main struct for handling all batch API calls
func NewClient ¶
NewClient returns a new instance of batch api client
func (*APIClient) TransactionalSend ¶
func (b *APIClient) TransactionalSend(payload TransactionalPushPayload) (TransactionalPushResponse, error)
TransactionalSend sends a transactional push notification and returns token in case of success See https://batch.com/doc/api/transactional.html
type TransactionalPushMessage ¶
type TransactionalPushMessage struct { Title string `json:"title,omitempty"` Body string `json:"body"` }
TransactionalPushMessage is a struct containing message title and body See https://batch.com/doc/api/transactional.html#_post-data
type TransactionalPushPayload ¶
type TransactionalPushPayload struct { GroupID string `json:"group_id"` Labels []string `json:"labels,omitempty"` Priority TransactionalPushPriority `json:"priority,omitempty"` Recipients TransactionalPushRecipient `json:"recipients"` Message TransactionalPushMessage `json:"message"` Deeplink string `json:"deeplink,omitempty"` }
TransactionalPushPayload TBA See https://batch.com/doc/api/transactional.html#_post-data
type TransactionalPushPriority ¶
type TransactionalPushPriority string
TransactionalPushPriority is a string aliased type for transtional push notifications priority See https://batch.com/doc/api/transactional.html#_post-data
const HighPriority TransactionalPushPriority = "high"
HighPriority is high transactional push priority constant
const NormalPriority TransactionalPushPriority = "normal"
NormalPriority is normal transactional push priority constant
type TransactionalPushRecipient ¶
type TransactionalPushRecipient struct { Tokens []string `json:"tokens,omitempty"` CustomIDs []string `json:"custom_ids,omitempty"` InstallIDs []string `json:"install_ids,omitempty"` }
TransactionalPushRecipient is a sturct containing tokens, custom ids and install ids of recipients See https://batch.com/doc/api/transactional.html#_post-data
type TransactionalPushResponse ¶
type TransactionalPushResponse struct {
Token string `json:"token"`
}
TransactionalPushResponse is the response type of transactional push notifications See https://batch.com/doc/api/transactional.html#_responses