@@ -275,21 +275,23 @@ public void trackInAppClick(@NonNull IterableInAppMessage message, @NonNull Stri
275275 }
276276 }
277277
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 ) {
279279 JSONObject requestJSON = new JSONObject ();
280280
281281 try {
282282 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)?
285285 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 );
287287 requestJSON .put (IterableConstants .ITERABLE_IN_APP_CLOSE_ACTION , closeAction .toString ());
288288 requestJSON .put (IterableConstants .KEY_MESSAGE_CONTEXT , getInAppMessageContext (message , clickLocation ));
289289 requestJSON .put (IterableConstants .KEY_DEVICE_INFO , getDeviceInfoJson ());
290+
290291 if (clickLocation == IterableInAppLocation .INBOX ) {
291292 addInboxSessionID (requestJSON , inboxSessionId );
292293 }
294+
293295 sendPostRequest (IterableConstants .ENDPOINT_TRACK_INAPP_CLOSE , requestJSON );
294296 } catch (JSONException e ) {
295297 e .printStackTrace ();
0 commit comments