From 96e6b6886cbf3eccc01515f3a024cb214bb3d9e3 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 9 Apr 2020 22:49:11 +0300 Subject: [PATCH] MobileMessagingCordova (#43763) * MobileMessagingCordova: add CustomEvents support * MobileMessagingCordova: fix lint * MobileMessagingCordova: change version * MobileMessaging: fix header Co-authored-by: Konstantin Latypov --- types/mobile-messaging-cordova/index.d.ts | 39 ++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/types/mobile-messaging-cordova/index.d.ts b/types/mobile-messaging-cordova/index.d.ts index 12fc075063..e2574c07e1 100644 --- a/types/mobile-messaging-cordova/index.d.ts +++ b/types/mobile-messaging-cordova/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package mobile-messaging-cordova-plugin 1.2 +// Type definitions for non-npm package mobile-messaging-cordova-plugin 1.3 // Project: https://github.com/infobip/mobile-messaging-cordova-plugin // Definitions by: kostap13 , // tjuric @@ -166,6 +166,43 @@ declare namespace MobileMessagingCordova { off(event: Event, handler: (message: Message) => void): void; + /** + * Sends an event to the server eventually, handles possible errors and do retries for you. + * + * @param eventData. An object containing event data + * { + * definitionId: "eventDefinitionId" + * properties: { + * "stringAttribute": "string", + * "numberAttribute": 1, + * "dateAttribute": "2020-02-26T09:41:57Z", + * "booleanAttribute": true + * } + * } + */ + submitEvent(eventData: CustomEvent): void; + + /** + * Sends an event to the server immediately. + * You have to handle possible connection or server errors, do retries yourself. + * + * @param eventData. An object containing event data + * { + * definitionId: "eventDefinitionId" + * properties: { + * "stringAttribute": "string", + * "numberAttribute": 1, + * "dateAttribute": "2020-02-26T09:41:57Z", + * "booleanAttribute": true + * } + * } + * @param callback will be called on result + * @param errorCallback will be called on error, you have to handle error and do retries yourself + */ + submitEventImmediately(eventData: CustomEvent, + callback: () => void, + errorCallback: () => void): void; + /** * Saves user data to the server. *