Skip to content

Commit fcdd973

Browse files
authored
Merge pull request #366 from Countly/fix_views
fix: views
2 parents 4570e00 + b642a31 commit fcdd973

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CountlyConnectionManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ extern const NSInteger kCountlyGETRequestMaxLength;
6969
- (NSString *)queryEssentials;
7070
- (NSString *)appendChecksum:(NSString *)queryString;
7171

72+
- (BOOL)isSessionStarted;
73+
7274
@end

CountlyConnectionManager.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ @interface CountlyConnectionManager ()
1616
@property (nonatomic) NSURLSession* URLSession;
1717

1818
@property (nonatomic, strong) NSDate *startTime;
19+
1920
@end
2021

2122
NSString* const kCountlyQSKeyAppKey = @"app_key";
@@ -105,6 +106,11 @@ - (instancetype)init
105106
return self;
106107
}
107108

109+
110+
- (BOOL)isSessionStarted {
111+
return isSessionStarted;
112+
}
113+
108114
- (void)resetInstance {
109115
CLY_LOG_I(@"%s", __FUNCTION__);
110116
onceToken = 0;

CountlyViewTrackingInternal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ - (NSString*)startViewInternal:(NSString *)viewName customSegmentation:(NSDictio
436436
segmentation[kCountlyVTKeySegment] = CountlyDeviceInfo.osName;
437437
segmentation[kCountlyVTKeyVisit] = @1;
438438

439-
if (self.isFirstView)
439+
if (self.isFirstView && [CountlyConnectionManager.sharedInstance isSessionStarted])
440440
{
441441
self.isFirstView = NO;
442442
segmentation[kCountlyVTKeyStart] = @1;
@@ -765,7 +765,7 @@ - (void)applicationWillTerminate {
765765

766766
- (void)resetFirstView
767767
{
768-
self.isFirstView = NO;
768+
self.isFirstView = YES;
769769
}
770770

771771

0 commit comments

Comments
 (0)