notif

package
v0.0.0-...-880b486 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApnsTransportType transportType = "apns"
	FcmTransportType  transportType = "fcm"
)

Variables

This section is empty.

Functions

func SendPushNotification

func SendPushNotification(ctx context.Context, config config.AblyConfig, device *model.UserDevice, pushBody PushNotificationBody) (bool, error)

Types

type AndroidPushNotification

type AndroidPushNotification struct {
	Recipient    FcmPushNotificationRecipient `json:"recipient"`
	Notification PushNotificationBody         `json:"notification"`
}

type ApnsPushNotificationRecipient

type ApnsPushNotificationRecipient struct {
	TransportType transportType `json:"transportType"`
	DeviceToken   string        `json:"deviceToken"`
}

type ApplePushNotification

type ApplePushNotification struct {
	Recipient    ApnsPushNotificationRecipient `json:"recipient"`
	Notification PushNotificationBody          `json:"notification"`
}

type FcmPushNotificationRecipient

type FcmPushNotificationRecipient struct {
	TransportType     transportType `json:"transportType"`
	RegistrationToken string        `json:"registrationToken"`
}

type PushNotificationBody

type PushNotificationBody struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

func BuildPushNotification

func BuildPushNotification(ctx context.Context, discussion model.Discussion, post model.Post, contentPreview *string) (*PushNotificationBody, error)

Jump to

Keyboard shortcuts

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