payload

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package payload serializes a JSON payload to push.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APS

type APS struct {
	// Alert dictionary.
	Alert Alert

	// Badge to display on the app icon.
	// Set to badge.Preserve (default), badge.Clear
	// or a specific value with badge.New(n).
	Badge badge.Badge

	// The name of a sound file to play as an alert.
	Sound string

	// Content available apps launched in the background or resumed...
	ContentAvailable bool

	// Category identifier for custom actions in iOS 8 or newer.
	Category string
}

APS is Apple's reserved namespace.

func (*APS) Map

func (a *APS) Map() map[string]interface{}

Map returns the APS payload as a map that you can customize before serializing it to JSON. TODO: Make this map implement json.Marshaler for use with Service.Push.

func (APS) MarshalJSON

func (a APS) MarshalJSON() ([]byte, error)

MarshalJSON allows you to json.Marshal(aps) directly.

type Alert

type Alert struct {
	// Title is a short string shown briefly on Apple Watch in iOS 8.2 or newer.
	Title        string   `json:"title,omitempty"`
	Body         string   `json:"body,omitempty"`
	Action       string   `json:"action,omitempty"`
	LocKey       string   `json:"loc-key,omitempty"`
	LocArgs      []string `json:"loc-args,omitempty"`
	ActionLocKey string   `json:"action-loc-key,omitempty"`
	LaunchImage  string   `json:"launch-image,omitempty"`
}

Alert dictionary.

type MDM

type MDM struct {
	Token string `json:"mdm"`
}

MDM payload for mobile device management.

Directories

Path Synopsis
Package badge allows you to preserve, set or clear the number displayed on your App icon.
Package badge allows you to preserve, set or clear the number displayed on your App icon.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL