@@ -275,21 +275,23 @@ public void trackInAppClick(@NonNull IterableInAppMessage message, @NonNull Stri
275
275
}
276
276
}
277
277
278
- void trackInAppClose (@ NonNull IterableInAppMessage message , @ NonNull String clickedURL , @ NonNull IterableInAppCloseAction closeAction , @ NonNull IterableInAppLocation clickLocation , @ Nullable String inboxSessionId ) {
278
+ void trackInAppClose (@ NonNull IterableInAppMessage message , @ Nullable String clickedURL , @ NonNull IterableInAppCloseAction closeAction , @ NonNull IterableInAppLocation clickLocation , @ Nullable String inboxSessionId ) {
279
279
JSONObject requestJSON = new JSONObject ();
280
280
281
281
try {
282
282
addEmailOrUserIdToJson (requestJSON );
283
- requestJSON .put (IterableConstants .KEY_EMAIL , authProvider .getEmail ());
284
- requestJSON .put (IterableConstants .KEY_USER_ID , authProvider .getUserId ());
283
+ // requestJSON.put(IterableConstants.KEY_EMAIL, authProvider.getEmail()); // not needed due to addEmailOrUserIdToJson(requestJSON)?
284
+ // requestJSON.put(IterableConstants.KEY_USER_ID, authProvider.getUserId()); // not needed due to addEmailOrUserIdToJson(requestJSON)?
285
285
requestJSON .put (IterableConstants .KEY_MESSAGE_ID , message .getMessageId ());
286
- requestJSON .put (IterableConstants .ITERABLE_IN_APP_CLICKED_URL , clickedURL );
286
+ requestJSON .putOpt (IterableConstants .ITERABLE_IN_APP_CLICKED_URL , clickedURL );
287
287
requestJSON .put (IterableConstants .ITERABLE_IN_APP_CLOSE_ACTION , closeAction .toString ());
288
288
requestJSON .put (IterableConstants .KEY_MESSAGE_CONTEXT , getInAppMessageContext (message , clickLocation ));
289
289
requestJSON .put (IterableConstants .KEY_DEVICE_INFO , getDeviceInfoJson ());
290
+
290
291
if (clickLocation == IterableInAppLocation .INBOX ) {
291
292
addInboxSessionID (requestJSON , inboxSessionId );
292
293
}
294
+
293
295
sendPostRequest (IterableConstants .ENDPOINT_TRACK_INAPP_CLOSE , requestJSON );
294
296
} catch (JSONException e ) {
295
297
e .printStackTrace ();
0 commit comments