diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerPlatform.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerPlatform.java index 59bdc57..5a5ef60 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerPlatform.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerPlatform.java @@ -55,7 +55,7 @@ public void start(@NonNull XatkitBot xatkitBot, @NonNull Configuration configura throw new RestHandlerException(HttpStatus.SC_FORBIDDEN, "Mode is not 'subscribe'"); } if (!token.equals(verifyToken)) { - throw new RestHandlerException(HttpStatus.SC_FORBIDDEN, "Token does not match verify token."); + throw new RestHandlerException(HttpStatus.SC_FORBIDDEN, "Received token does not match the verify token."); } return new StringEntity(challenge, StandardCharsets.UTF_8); })); @@ -73,6 +73,8 @@ public MessengerResponse markSeen(@NonNull StateContext context) { /** * Send an action. Actions: "mark_seen", "typing_on" or "typing_off". + * Sender actions "typing_on" and "typing_off" won't be supported by Facebook for European users + * since 16th of December 2020. * * @param context the current {@link StateContext} * @param senderAction the {@link SenderAction} @@ -93,6 +95,9 @@ public MessengerResponse sendAction(@NonNull StateContext context, @NonNull Send * If a request is successfully sent returns a {@link MessengerResponse}. * If an error response is received from Facebook throws a {@link MessengerException} * If an unknown error is encountered throws a {@link XatkitException} + *

+ * Media/attachment (audio, video, files) other than images + * won't be supported by Facebook for European users since 16th of December 2020. * * @param context the current {@link StateContext} * @param file the {@link File} @@ -108,6 +113,9 @@ public MessengerResponse uploadFile(@NonNull StateContext context, File file) { * If a request is successfully sent returns a {@link MessengerResponse}. * If an error response is received from Facebook throws a {@link MessengerException} * If an unknown error is encountered throws a {@link XatkitException} + *

+ * Media/attachment (audio, video, files) other than images + * won't be supported by Facebook for European users since 16th of December 2020. * * @param context the current {@link StateContext} * @param attachmentId id of the attachment to be sent. @@ -127,6 +135,9 @@ public MessengerResponse sendFile(@NonNull StateContext context, @NonNull String * Sends {@link File}. If the {@link File} doesn't have an attachment_id, then uploads the file and adds an attachment_id to it. * Otherwise assumes that the attachment_id of the file is correct and uses it to send the file. * Calls {@link #sendFile(StateContext, File, boolean)} + *

+ * Media/attachment (audio, video, files) other than images + * won't be supported by Facebook for European users since 16th of December 2020. * * @param context the current {@link StateContext} * @param file the {@link File} @@ -142,6 +153,9 @@ public MessengerResponse sendFile(@NonNull StateContext context, @NonNull File f * Sends the {@link File}. If the {@link File} doesn't have an attachment_id, then uploads the file and adds an attachment_id to it. * If reupload is true, always uploads the file, otherwise assumes that the attachment_id present in the {@link File} is correct. * Calls {@link #sendFile(StateContext, String, Attachment.AttachmentType)}. + *

+ * Media/attachment (audio, video, files) other than images + * won't be supported by Facebook for European users since 16th of December 2020. * * @param context the current {@link StateContext} * @param file the {@link File} diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerUtils.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerUtils.java index 66987f1..c0ced1d 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerUtils.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/MessengerUtils.java @@ -33,26 +33,36 @@ public class MessengerUtils { /** * Create intent from reaction if true, otherwise use events. Value type: boolean + * Won't be supported by Facebook for European users since 16th of December 2020. */ + @Deprecated public static final String INTENT_FROM_REACTION = MESSENGER_CONTEXT + "intent_from_reaction"; /** * If true use reaction text to create an intent otherwise uses emoji. Value type: boolean * Requires INTENT_FROM_REACTION to be true to work. + * Won't be supported by Facebook for European users since 16th of December 2020. */ + @Deprecated public static final String USE_REACTION_TEXT = MESSENGER_CONTEXT + "use_reaction_text"; /** * Whether to handle reactions or not. Value type: boolean + * Won't be supported by Facebook for European users since 16th of December 2020. */ + @Deprecated public static final String HANDLE_REACTIONS_KEY = MESSENGER_CONTEXT + "handle_reactions"; /** * Whether to handle deliveries or not. Value type: boolean + * Won't be supported by Facebook for European users since 16th of December 2020. */ + @Deprecated public static final String HANDLE_DELIVERIES_KEY = MESSENGER_CONTEXT + "handle_deliveries"; /** * Whether to handle reads or not. Value type: boolean + * Won't be supported by Facebook for European users since 16th of December 2020. */ + @Deprecated public static final String HANDLE_READ_KEY = MESSENGER_CONTEXT + "handle_read"; // EXPERIMENTAL FEATURES @@ -60,6 +70,7 @@ public class MessengerUtils { * If true automatically marks received messages as seen. Value type: boolean */ public static final String AUTO_MARK_SEEN_KEY = MESSENGER_CONTEXT + "auto_seen"; + public static final String NATURALIZE_TEXT = MESSENGER_CONTEXT + "naturalize_text"; // INTENT PLATFORM DATA KEYS diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/Attachment.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/Attachment.java index a08eb34..7a7218e 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/Attachment.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/Attachment.java @@ -19,14 +19,17 @@ public class Attachment { // TODO: Support files and templates as well public enum AttachmentType { + @Deprecated @SerializedName("audio") audio, + @Deprecated @SerializedName("video") video, @SerializedName("image") image, @SerializedName("template") template, + @Deprecated @SerializedName("file") file } diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/SenderAction.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/SenderAction.java index 1726fd1..b7787b7 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/SenderAction.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/SenderAction.java @@ -4,11 +4,16 @@ /** * Actions that can be sent to Facebook. + * Sender actions "typing_on" and "typing_off" won't be supported by Facebook for European users + * since 16th of December 2020. + * * @see Messaging */ public enum SenderAction { + @Deprecated @SerializedName("typing_on") typingOn, + @Deprecated @SerializedName("typing_off") typingOff, @SerializedName("mark_seen") diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/ButtonTemplatePayload.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/ButtonTemplatePayload.java index bd1a426..84d1f61 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/ButtonTemplatePayload.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/ButtonTemplatePayload.java @@ -9,6 +9,7 @@ * Used for creating templates with buttons. * Only Android and iOS support by Facebook for European users since 16th of December 2020. */ +@Deprecated public class ButtonTemplatePayload extends TemplatePayload { @Getter private final String text; //UTF-8 encoded 640 character limit diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/GenericTemplatePayload.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/GenericTemplatePayload.java index 7ed503e..7e72861 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/GenericTemplatePayload.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/GenericTemplatePayload.java @@ -12,6 +12,7 @@ * Used for creating Generic Templates. * Only Android and iOS support by Facebook for European users since 16th of December 2020. */ +@Deprecated public class GenericTemplatePayload extends TemplatePayload { @SerializedName(value = "image_aspect_ratio") @Getter diff --git a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/MediaTemplatePayload.java b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/MediaTemplatePayload.java index 82debaa..b4afe73 100644 --- a/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/MediaTemplatePayload.java +++ b/runtime/src/main/java/com/xatkit/plugins/messenger/platform/entity/payloads/MediaTemplatePayload.java @@ -9,6 +9,7 @@ * Used for creating Media Templates. * Only Android and iOS support by Facebook for European users since 16th of December 2020. */ +@Deprecated public class MediaTemplatePayload extends TemplatePayload { @Getter private final List elements; // Maximum size is 1