Skip to content

Commit

Permalink
Added FirstView implmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ijunaid committed Aug 23, 2023
1 parent 0f5cbc4 commit eda543b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CountlyConnectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ - (void)endSession
[CountlyPersistency.sharedInstance addToQueue:queryString];

[self proceedOnQueue];

[CountlyViewTrackingInternal.sharedInstance resetFirstView];
}

#pragma mark ---
Expand Down
1 change: 1 addition & 0 deletions CountlyViewTrackingInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern NSString* const kCountlyReservedEventView;
- (void)applicationDidEnterBackground;
- (void)applicationWillEnterForeground;
- (void)applicationWillTerminate;
- (void)resetFirstView;

#if (TARGET_OS_IOS || TARGET_OS_TV)
- (void)addAutoViewTrackingExclutionList:(NSArray *)viewTrackingExclusionList;
Expand Down
13 changes: 12 additions & 1 deletion CountlyViewTrackingInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ @interface CountlyViewTrackingInternal ()
#endif
@property (nonatomic) NSMutableDictionary<NSString*, CountlyViewData *> * viewDataDictionary;
@property (nonatomic) NSMutableDictionary* viewSegmentation;
@property (nonatomic) BOOL isFirstView;
@end

NSString* const kCountlyReservedEventView = @"[CLY]_view";
Expand Down Expand Up @@ -100,6 +101,7 @@ - (instancetype)init

self.viewDataDictionary = NSMutableDictionary.new;
self.viewSegmentation = nil;
self.isFirstView = true;
}

return self;
Expand Down Expand Up @@ -406,8 +408,11 @@ - (NSString*)startViewInternal:(NSString *)viewName customSegmentation:(NSDictio
segmentation[kCountlyVTKeySegment] = CountlyDeviceInfo.osName;
segmentation[kCountlyVTKeyVisit] = @1;

if (!self.currentViewID)
if (self.isFirstView)
{
self.isFirstView = false;
segmentation[kCountlyVTKeyStart] = @1;
}

if (self.viewSegmentation)
{
Expand Down Expand Up @@ -651,6 +656,12 @@ - (void)applicationWillTerminate {
}


- (void)resetFirstView
{
self.isFirstView = false;
}


@end

#pragma mark -
Expand Down

0 comments on commit eda543b

Please sign in to comment.