body

package
v3.8.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TAG            = "tag"
	TAGAND         = "tag_and"
	TAGNOT         = "tag_not"
	ALIAS          = "alias"
	REGISTRATIONID = "registration_id"
)
View Source
const (
	ANDROID      = "android"
	IOS          = "ios"
	QUICKAPP     = "quickapp"
	WINDOWSPHONE = "winphone"
	ALL          = "all"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Android

type Android struct {
	Alert  string `json:"alert,omitempty"`
	Intent struct {
		URL string `json:"url,omitempty"`
	} `json:"intent,omitempty"`
	Extras Extras `json:"extras"`
}

type Audience

type Audience struct {
	Object any
	// contains filtered or unexported fields
}

func (*Audience) SetAlias

func (a *Audience) SetAlias(alias []string)

func (*Audience) SetAll

func (a *Audience) SetAll()

func (*Audience) SetRegistrationId

func (a *Audience) SetRegistrationId(ids []string)

func (*Audience) SetTag

func (a *Audience) SetTag(tags []string)

func (*Audience) SetTagAnd

func (a *Audience) SetTagAnd(tags []string)

func (*Audience) SetTagNot

func (a *Audience) SetTagNot(tags []string)

type Extras

type Extras struct {
	ClientMsgID string `json:"clientMsgID"`
}

type Ios

type Ios struct {
	Alert          string `json:"alert,omitempty"`
	Sound          string `json:"sound,omitempty"`
	Badge          string `json:"badge,omitempty"`
	Extras         Extras `json:"extras"`
	MutableContent bool   `json:"mutable-content"`
}

type Message

type Message struct {
	MsgContent  string         `json:"msg_content"`
	Title       string         `json:"title,omitempty"`
	ContentType string         `json:"content_type,omitempty"`
	Extras      map[string]any `json:"extras,omitempty"`
}

func (*Message) SetContentType

func (m *Message) SetContentType(c string)

func (*Message) SetExtras

func (m *Message) SetExtras(key string, value any)

func (*Message) SetMsgContent

func (m *Message) SetMsgContent(c string)

func (*Message) SetTitle

func (m *Message) SetTitle(t string)

type Notification

type Notification struct {
	Alert   string  `json:"alert,omitempty"`
	Android Android `json:"android,omitempty"`
	IOS     Ios     `json:"ios,omitempty"`
}

func (*Notification) IOSEnableMutableContent

func (n *Notification) IOSEnableMutableContent()

func (*Notification) SetAlert

func (n *Notification) SetAlert(alert string)

func (*Notification) SetAndroidIntent

func (n *Notification) SetAndroidIntent(pushConf *config.Push)

func (*Notification) SetExtras

func (n *Notification) SetExtras(extras Extras)

type Options

type Options struct {
	ApnsProduction bool `json:"apns_production"`
}

func (*Options) SetApnsProduction

func (o *Options) SetApnsProduction(c bool)

type Platform

type Platform struct {
	Os any
	// contains filtered or unexported fields
}

func (*Platform) Set

func (p *Platform) Set(os string) error

func (*Platform) SetAll

func (p *Platform) SetAll()

func (*Platform) SetAndroid

func (p *Platform) SetAndroid() error

func (*Platform) SetIOS

func (p *Platform) SetIOS() error

func (*Platform) SetPlatform

func (p *Platform) SetPlatform(platform string) error

func (*Platform) SetQuickApp

func (p *Platform) SetQuickApp() error

func (*Platform) SetWindowsPhone

func (p *Platform) SetWindowsPhone() error

type PushObj

type PushObj struct {
	Platform     any `json:"platform"`
	Audience     any `json:"audience"`
	Notification any `json:"notification,omitempty"`
	Message      any `json:"message,omitempty"`
	Options      any `json:"options,omitempty"`
}

func (*PushObj) SetAudience

func (p *PushObj) SetAudience(ad *Audience)

func (*PushObj) SetMessage

func (p *PushObj) SetMessage(m *Message)

func (*PushObj) SetNotification

func (p *PushObj) SetNotification(no *Notification)

func (*PushObj) SetOptions

func (p *PushObj) SetOptions(o *Options)

func (*PushObj) SetPlatform

func (p *PushObj) SetPlatform(pf *Platform)

Jump to

Keyboard shortcuts

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