onesignal

package module
v0.0.0-...-2024e58 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

README

onesignal

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotificationsService = "https://onesignal.com/api/v1/notifications"

NotificationsService doc ...

View Source
var PlayersService = "https://onesignal.com/api/v1/players"

PlayersService doc ...

Functions

func AddDevice

func AddDevice(data OSAddDeviceReq) (string, error)

AddDevice ...

func SendNotification

func SendNotification(data NotificationRequest, oneSignalKey string) (string, error)

SendNotification ...

Types

type Contents

type Contents struct {
	En string `json:"en"`
	Es string `json:"es"`
}

Contents doc ...

type Headings

type Headings struct {
	En string `json:"en"`
	Es string `json:"es"`
}

Headings doc ...

type NotificationRequest

type NotificationRequest struct {
	AppID            string   `json:"app_id"`
	IncludedSegments []string `json:"included_segments"`
	IncludePlayerIds []string `json:"include_player_ids"`
	Data             struct {
		Foo string `json:"foo"`
	} `json:"data"`
	Headings  Headings `json:"headings"`
	Contents  Contents `json:"contents"`
	LargeIcon string   `json:"large_icon"`
}

NotificationRequest ...

type NotificationResponse

type NotificationResponse struct {
	ID         string      `json:"id"`
	Recipients int         `json:"recipients"`
	ExternalID interface{} `json:"external_id"`
}

NotificationResponse doc ...

type OSAddDeviceReq

type OSAddDeviceReq struct {
	AppID       string `json:"app_id"`
	DeviceModel string `json:"device_model"`
	DeviceOs    string `json:"device_os"`
	DeviceType  int    `json:"device_type"`
	GameVersion string `json:"game_version"`
	Identifier  string `json:"identifier"`
	Language    string `json:"language"`
	Tags        struct {
		A   string `json:"a"`
		Foo string `json:"foo"`
	} `json:"tags"`
	Timezone int `json:"timezone"`
}

OSAddDeviceReq ...

type OSAddDeviceRes

type OSAddDeviceRes struct {
	Success bool   `json:"success"`
	ID      string `json:"id"`
}

OSAddDeviceRes ...

Jump to

Keyboard shortcuts

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