diff --git a/.gitignore b/.gitignore index 33fde1a2..514f2514 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ log results browserstack.json .DS_Store +package-lock.json stats.json .idea .cursor \ No newline at end of file diff --git a/README.md b/README.md index d6adb437..e9f4c9fa 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Iterable's API, see the [API Overview](https://support.iterable.com/hc/articles/ Notes: -- The SDK does not track `inAppDelete` events. +- The SDK supports generating `inAppDelete` events by passing `deleteAction` to `trackInAppConsume`. - :rotating_light: Due to a limitation in WebKit (which affects iOS web browsers, like Safari), in-app messages displayed in an iOS web browser browser can't @@ -859,7 +859,7 @@ See also: ## `trackInAppConsume` -Deletes an in-app message from the server by calling [`POST /api/events/trackInAppConsume`](https://support.iterable.com/hc/articles/204780579#post-api-events-inappconsume). +Deletes an in-app message from the server by calling [`POST /api/events/trackInAppConsume`](https://support.iterable.com/hc/articles/204780579#post-api-events-inappconsume). Pass `deleteAction` to generate an `inAppDelete` event. ```ts const trackInAppConsume = ( @@ -1408,6 +1408,7 @@ interface InAppEventRequestParams { location?: string; }; closeAction?: string; + deleteAction?: string; deviceInfo: { appPackageName: string; }; diff --git a/src/events/events.schema.ts b/src/events/events.schema.ts index b515525d..70e5b8e1 100644 --- a/src/events/events.schema.ts +++ b/src/events/events.schema.ts @@ -18,6 +18,7 @@ export const eventRequestSchema = object().shape({ location: string() }), closeAction: string(), + deleteAction: string(), deviceInfo: object() .shape({ deviceId: string().required(), diff --git a/src/events/inapp/events.schema.ts b/src/events/inapp/events.schema.ts index 24fd49b1..dc517b0c 100644 --- a/src/events/inapp/events.schema.ts +++ b/src/events/inapp/events.schema.ts @@ -9,6 +9,7 @@ export const eventRequestSchema = object().shape({ location: string() }), closeAction: string(), + deleteAction: string(), deviceInfo: object() .shape({ deviceId: string().required(), diff --git a/src/events/inapp/types.ts b/src/events/inapp/types.ts index 676eef7d..6753b709 100644 --- a/src/events/inapp/types.ts +++ b/src/events/inapp/types.ts @@ -15,6 +15,7 @@ export interface InAppEventRequestParams { location?: string; }; closeAction?: string; + deleteAction?: string; deviceInfo: { appPackageName: string; // customer-defined name };