From 87975a197003273b2ecb81aebe55f46fe784b319 Mon Sep 17 00:00:00 2001 From: Depado Date: Fri, 9 Dec 2016 11:04:14 +0100 Subject: [PATCH] Add missing fields of CallToActionItem (#22) * Adding WebViewHeightRatio and MessengerExtension fields * Adding constants and documentation --- settings.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/settings.go b/settings.go index a973168..97cd583 100644 --- a/settings.go +++ b/settings.go @@ -1,5 +1,22 @@ package messenger +// Defines the different sizes available when setting up a CallToActionsItem +// of type "web_url". These values can be used in the "WebviewHeightRatio" +// field. +const ( + // WebviewCompact opens the page in a web view that takes half the screen + // and covers only part of the conversation. + WebviewCompact = "compact" + + // WebviewTall opens the page in a web view that covers about 75% of the + // conversation. + WebviewTall = "tall" + + // WebviewFull opens the page in a web view that completely covers the + // conversation, and has a "back" button instead of a "close" one. + WebviewFull = "full" +) + // GreetingSetting is the setting for greeting message type GreetingSetting struct { SettingType string `json:"setting_type"` @@ -20,8 +37,10 @@ type CallToActionsSetting struct { // CallToActionsItem contains Get Started button or item of Persist Menu type CallToActionsItem struct { - Type string `json:"type,omitempty"` - Title string `json:"title,omitempty"` - Payload string `json:"payload,omitempty"` - URL string `json:"url,omitempty"` + Type string `json:"type,omitempty"` + Title string `json:"title,omitempty"` + Payload string `json:"payload,omitempty"` + URL string `json:"url,omitempty"` + WebviewHeightRatio string `json:"webview_height_ratio,omitempty"` + MessengerExtension bool `json:"messenger_extensions,omitempty"` }