Skip to content

Commit

Permalink
feat: usage of ids
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Jan 5, 2024
1 parent a8f684c commit 1e9179c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void autoCloseRequiredViews(boolean closeAllViews, Map<String, Object> customVie
firstView = false;
}

recordView(0.0, viewSegmentation);
recordView(currentViewID, 0.0, viewSegmentation);
return currentViewData.viewID;
}

Expand All @@ -191,14 +191,14 @@ void stopViewWithIDInternal(@Nullable String viewID, @Nullable Map<String, Objec
viewDataMap.remove(vd.viewID);
}

void recordView(Double duration, Map<String, Object> segmentation) {
ModuleEvents.Events events = Countly.instance().events();
void recordView(String id, Double duration, Map<String, Object> segmentation) {
ModuleEvents events = internalConfig.sdk.module(ModuleEvents.class);
if (events == null) {
L.e("[ModuleViews] recordView, events module is not initialized");
return;
}

events.recordEvent(KEY_VIEW_EVENT, segmentation, 1, 0.0, duration);
events.recordEventInternal(KEY_VIEW_EVENT, 1, 0.0, duration, segmentation, id);
}

void recordViewEndEvent(ViewData vd, @Nullable Map<String, Object> filteredCustomViewSegmentation, String viewRecordingSource) {
Expand All @@ -220,7 +220,7 @@ void recordViewEndEvent(ViewData vd, @Nullable Map<String, Object> filteredCusto

long viewDurationSeconds = lastElapsedDurationSeconds;
Map<String, Object> segments = createViewEventSegmentation(vd, false, false, filteredCustomViewSegmentation);
recordView(new Long(viewDurationSeconds).doubleValue(), segments);
recordView(vd.viewID, new Long(viewDurationSeconds).doubleValue(), segments);
}

void pauseViewWithIDInternal(String viewID) {
Expand Down

0 comments on commit 1e9179c

Please sign in to comment.