Skip to content

Commit

Permalink
Merge pull request #366 from Countly/fix_views
Browse files Browse the repository at this point in the history
fix: views
  • Loading branch information
turtledreams authored Dec 3, 2024
2 parents 4570e00 + b642a31 commit fcdd973
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CountlyConnectionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ extern const NSInteger kCountlyGETRequestMaxLength;
- (NSString *)queryEssentials;
- (NSString *)appendChecksum:(NSString *)queryString;

- (BOOL)isSessionStarted;

@end
6 changes: 6 additions & 0 deletions CountlyConnectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ @interface CountlyConnectionManager ()
@property (nonatomic) NSURLSession* URLSession;

@property (nonatomic, strong) NSDate *startTime;

@end

NSString* const kCountlyQSKeyAppKey = @"app_key";
Expand Down Expand Up @@ -105,6 +106,11 @@ - (instancetype)init
return self;
}


- (BOOL)isSessionStarted {
return isSessionStarted;
}

- (void)resetInstance {
CLY_LOG_I(@"%s", __FUNCTION__);
onceToken = 0;
Expand Down
4 changes: 2 additions & 2 deletions CountlyViewTrackingInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ - (NSString*)startViewInternal:(NSString *)viewName customSegmentation:(NSDictio
segmentation[kCountlyVTKeySegment] = CountlyDeviceInfo.osName;
segmentation[kCountlyVTKeyVisit] = @1;

if (self.isFirstView)
if (self.isFirstView && [CountlyConnectionManager.sharedInstance isSessionStarted])
{
self.isFirstView = NO;
segmentation[kCountlyVTKeyStart] = @1;
Expand Down Expand Up @@ -765,7 +765,7 @@ - (void)applicationWillTerminate {

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


Expand Down

0 comments on commit fcdd973

Please sign in to comment.