From 2427d308507ec3942f13fe957c40307c805af995 Mon Sep 17 00:00:00 2001 From: Yusuke Komatsu Date: Wed, 22 Jan 2020 11:21:51 +0900 Subject: [PATCH] add RTM event: mobile_in_app_notification --- websocket_managed_conn.go | 3 ++- websocket_mobile_in_app_notification.go | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 websocket_mobile_in_app_notification.go diff --git a/websocket_managed_conn.go b/websocket_managed_conn.go index dbbf682df..9eaaa6644 100644 --- a/websocket_managed_conn.go +++ b/websocket_managed_conn.go @@ -577,5 +577,6 @@ var EventMapping = map[string]interface{}{ "subteam_self_removed": SubteamSelfRemovedEvent{}, "subteam_updated": SubteamUpdatedEvent{}, - "desktop_notification": DesktopNotificationEvent{}, + "desktop_notification": DesktopNotificationEvent{}, + "mobile_in_app_notification": MobileInAppNotificationEvent{}, } diff --git a/websocket_mobile_in_app_notification.go b/websocket_mobile_in_app_notification.go new file mode 100644 index 000000000..e3cfb3d9f --- /dev/null +++ b/websocket_mobile_in_app_notification.go @@ -0,0 +1,20 @@ +package slack + +// MobileInAppNotificationEvent represents the update event for Mobile App Notification. +type MobileInAppNotificationEvent struct { + Type string `json:"type"` + Title string `json:"title"` + Subtitle string `json:"subtitle"` + Timestamp string `json:"ts"` + Channel string `json:"channel"` + AvatarImage string `json:"avatarImage"` + IsShared bool `json:"is_shared"` + ChannelName string `json:"channel_name"` + AuthorID string `json:"author_id"` + AuthorDisplayName string `json:"author_display_name"` + MessageText string `json:"msg_text"` + PushID string `json:"push_id"` + NotifcationID string `json:"notif_id"` + MobileLaunchURI string `json:"mobileLaunchUri"` + EventTimestamp string `json:"event_ts"` +}