notify

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

View Source
const (
	SegmentSubscribedUsers Segment = "Subscribed Users" // 所有已订阅的用户
	SegmentActiveUsers     Segment = "Active Users"     // 最近一周活跃的用户
	SegmentEngagedUsers    Segment = "Engaged Users"    // 最近一周重度依赖的用户
	SegmentInactiveUsers   Segment = "Inactive Users"   // 超过一周没有活跃的用户

	NotificationClickEventNone                  NotificationClickEvent = "none"                    // 空事件,点击通知什么都不会发送
	NotificationClickEventLoginAbnormal         NotificationClickEvent = "login_abnormal"          // 新的系统通知事件
	NotificationClickEventNewSystemNotification NotificationClickEvent = "new_system_notification" // 新的系统通知事件
	NotificationClickEventNewUserMessage        NotificationClickEvent = "new_user_message"        // 新的系统通知事件
)

Variables

Functions

This section is empty.

Types

type Event added in v0.5.0

type Event string
const (
	EventSendNotifyToAllUser             Event = "EventSendNotifyToAllUser"             // 推送给所有用户
	EventSendNotifyToCustomUser          Event = "EventSendNotifyToCustomUser"          // 推送给指定用户
	EventSendNotifyCheckUserLoginStatus  Event = "EventSendNotifyCheckUserLoginStatus"  // 推送检查用户登录状态
	EventSendNotifyToUserNewNotification Event = "EventSendNotifyToUserNewNotification" // 推送新的系统通知
	EventSendNotifyToUserNewMessage      Event = "EventSendNotifyToUserNewMessage"      // 推送指定用户的个人消息
)

type NotificationBody added in v0.5.0

type NotificationBody struct {
	Event   NotificationClickEvent `json:"event"`   // 事件名
	Payload interface{}            `json:"payload"` // 数据体
}

发送推送附带的数据体结构 event 给 APP 识别 payload 是附带的数据

type NotificationClickEvent added in v0.5.0

type NotificationClickEvent string // 推送的点击事件

type Notifier

type Notifier interface {
	SendNotifyToAllUser(headings string, content string, data map[string]interface{}) error                      // 向所有用户推送
	SendNotifyToCustomUser(userIds []string, headings string, content string, data map[string]interface{}) error // 推送自定义通知
	SendNotifySystemNotificationToUser(notificationId string) error                                              // 推送系统通知
	SendNotifyUserNewMessage(messageId string) error                                                             // 推送用户消息
	SendNotifyToUserForLoginStatus(userID string) error                                                          // 推送用户登录异常
}

type NotifierOneSignal

type NotifierOneSignal struct {
}

func NewNotifierOneSignal

func NewNotifierOneSignal() *NotifierOneSignal

func (*NotifierOneSignal) SendNotifySystemNotificationToUser added in v0.5.0

func (n *NotifierOneSignal) SendNotifySystemNotificationToUser(notificationId string) error

func (*NotifierOneSignal) SendNotifyToAllUser

func (n *NotifierOneSignal) SendNotifyToAllUser(headings string, content string, data map[string]interface{}) error

func (*NotifierOneSignal) SendNotifyToCustomUser

func (n *NotifierOneSignal) SendNotifyToCustomUser(userId []string, headings string, content string, data map[string]interface{}) error

func (*NotifierOneSignal) SendNotifyToUserForLoginStatus added in v0.5.0

func (n *NotifierOneSignal) SendNotifyToUserForLoginStatus(userID string) error

func (*NotifierOneSignal) SendNotifyUserNewMessage added in v0.7.0

func (n *NotifierOneSignal) SendNotifyUserNewMessage(messageId string) error

type Segment added in v0.5.0

type Segment string // 用户细分群体

Jump to

Keyboard shortcuts

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