Skip to content

Commit efa41a3

Browse files
authored
Merge pull request #147 from erkanyildiz/master
For 19.08
2 parents e5d967f + d606785 commit efa41a3

32 files changed

+546
-1250
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OS generated files #
2+
######################
3+
.DS_Store
4+
.DS_Store?
5+
._*
6+
.Spotlight-V100
7+
.Trashes
8+
ehthumbs.db
9+
Thumbs.db
10+
.LSOverride
11+
Countly.xcodeproj/project.xcworkspace/
12+
Countly.xcodeproj/xcuserdata/

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
## 19.08
2+
- Added temporary device ID mode
3+
- Added support for Carthage
4+
- Added custom URL session configuration support
5+
- Added custom segmentation support on view tracking
6+
- Added ability to change app key on the run
7+
- Added ability to flush queues
8+
- Added `pushTestMode` property and discarded `isTestDevice` property
9+
- Fixed `WCSessionDelegate` interception
10+
- Fixed title and message check in push notification payloads
11+
- Fixed binary image name extraction for crash reports
12+
- Fixed missing delegate forwarding for `userNotificationCenter:openSettingsForNotification:` method
13+
- Fixed in-app alerts on iOS10+ devices when a silent notification with alert key arrives
14+
- Discarded device ID persistency on Keychain
15+
- Discarded OpenUDID device ID option
16+
- Discarded IDFA device ID option
17+
- Discarded zero IDFA fix
18+
- Updated default device ID on tvOS as `identifierForVendor`
19+
20+
- Other various improvements
21+
- Renamed `forceDeviceIDInitialization` flag as `resetStoredDeviceID`
22+
- Added lightweight generics for segmentation parameters
23+
- Added dSYM upload script to preserved paths in Podspec
24+
- Updated dSYM upload script to support paths with spaces
25+
- Changed request cache policy to `NSURLRequestReloadIgnoringLocalCacheData`
26+
- Added battery level for watchOS 4.0+
27+
- Added JSON validity check before converting objects
28+
- Deleted unused `kCountlyCRKeyLoadAddress` constant
29+
- Improved internal logging in binary images processing for crash reports
30+
- Added persistency for generated `NSUUID`
31+
- Added precaution to prevent invalid requests from being added to queue
32+
- Discarded null check on request queue
33+
- Discarded all APM related files
34+
- Added length check for view tracking view name
35+
- Added length check for view tracking exceptions
36+
- Updated HeaderDocs, internal logs, inline notes and pragma marks
37+
38+
39+
140
## 19.02
241
- Added push notification support for macOS
342
- Added provisional push notification permission support for iOS12

Countly.h

Lines changed: 86 additions & 50 deletions
Large diffs are not rendered by default.

Countly.m

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ - (void)startWithConfig:(CountlyConfig *)config
7272

7373
COUNTLY_LOG(@"Initializing with %@ SDK v%@", kCountlySDKName, kCountlySDKVersion);
7474

75-
if (!CountlyDeviceInfo.sharedInstance.deviceID || config.forceDeviceIDInitialization)
75+
if (!CountlyDeviceInfo.sharedInstance.deviceID || config.resetStoredDeviceID)
7676
[CountlyDeviceInfo.sharedInstance initializeDeviceID:config.deviceID];
7777

7878
CountlyConnectionManager.sharedInstance.appKey = config.appKey;
@@ -83,7 +83,7 @@ - (void)startWithConfig:(CountlyConfig *)config
8383
CountlyConnectionManager.sharedInstance.customHeaderFieldName = config.customHeaderFieldName;
8484
CountlyConnectionManager.sharedInstance.customHeaderFieldValue = config.customHeaderFieldValue;
8585
CountlyConnectionManager.sharedInstance.secretSalt = config.secretSalt;
86-
CountlyConnectionManager.sharedInstance.applyZeroIDFAFix = config.applyZeroIDFAFix;
86+
CountlyConnectionManager.sharedInstance.URLSessionConfiguration = config.URLSessionConfiguration;
8787

8888
CountlyPersistency.sharedInstance.eventSendThreshold = config.eventSendThreshold;
8989
CountlyPersistency.sharedInstance.storedRequestsLimit = MAX(1, config.storedRequestsLimit);
@@ -121,7 +121,7 @@ - (void)startWithConfig:(CountlyConfig *)config
121121
if ([config.features containsObject:CLYPushNotifications])
122122
{
123123
CountlyPushNotifications.sharedInstance.isEnabledOnInitialConfig = YES;
124-
CountlyPushNotifications.sharedInstance.isTestDevice = config.isTestDevice;
124+
CountlyPushNotifications.sharedInstance.pushTestMode = config.pushTestMode;
125125
CountlyPushNotifications.sharedInstance.sendPushTokenAlways = config.sendPushTokenAlways;
126126
CountlyPushNotifications.sharedInstance.doNotShowAlertForNotifications = config.doNotShowAlertForNotifications;
127127
CountlyPushNotifications.sharedInstance.launchNotification = config.launchNotification;
@@ -137,10 +137,6 @@ - (void)startWithConfig:(CountlyConfig *)config
137137
}
138138
#endif
139139

140-
//NOTE: Disable APM feature until server completely supports it
141-
// if ([config.features containsObject:CLYAPM])
142-
// [CountlyAPM.sharedInstance startAPM];
143-
144140
timer = [NSTimer scheduledTimerWithTimeInterval:config.updateSessionPeriod target:self selector:@selector(onTimer:) userInfo:nil repeats:YES];
145141
[NSRunLoop.mainRunLoop addTimer:timer forMode:NSRunLoopCommonModes];
146142

@@ -163,25 +159,34 @@ - (void)setNewDeviceID:(NSString *)deviceID onServer:(BOOL)onServer
163159
if (!CountlyConsentManager.sharedInstance.hasAnyConsent)
164160
return;
165161

166-
#pragma GCC diagnostic push
167-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
162+
deviceID = [CountlyDeviceInfo.sharedInstance ensafeDeviceID:deviceID];
168163

169-
#if TARGET_OS_IOS
170-
if ([deviceID isEqualToString:CLYIDFA])
171-
deviceID = [CountlyDeviceInfo.sharedInstance zeroSafeIDFA];
172-
else if ([deviceID isEqualToString:CLYIDFV])
173-
deviceID = UIDevice.currentDevice.identifierForVendor.UUIDString;
174-
else if ([deviceID isEqualToString:CLYOpenUDID])
175-
deviceID = [Countly_OpenUDID value];
176-
#elif TARGET_OS_OSX
177-
if ([deviceID isEqualToString:CLYOpenUDID])
178-
deviceID = [Countly_OpenUDID value];
179-
#endif
164+
if ([deviceID isEqualToString:CountlyDeviceInfo.sharedInstance.deviceID])
165+
{
166+
COUNTLY_LOG(@"Attempted to set the same device ID again. So, setting new device ID is aborted.");
167+
return;
168+
}
180169

181-
#pragma GCC diagnostic pop
170+
if (CountlyDeviceInfo.sharedInstance.isDeviceIDTemporary)
171+
{
172+
COUNTLY_LOG(@"Going out of CLYTemporaryDeviceID mode and switching back to normal mode.");
173+
174+
[CountlyDeviceInfo.sharedInstance initializeDeviceID:deviceID];
175+
176+
[CountlyPersistency.sharedInstance replaceAllTemporaryDeviceIDsInQueueWithDeviceID:deviceID];
177+
178+
[CountlyConnectionManager.sharedInstance proceedOnQueue];
179+
180+
[CountlyRemoteConfig.sharedInstance startRemoteConfig];
182181

183-
if ([deviceID isEqualToString:CountlyDeviceInfo.sharedInstance.deviceID])
184182
return;
183+
}
184+
185+
if ([deviceID isEqualToString:CLYTemporaryDeviceID] && onServer)
186+
{
187+
COUNTLY_LOG(@"Attempted to set device ID as CLYTemporaryDeviceID with onServer option. So, onServer value is overridden as NO.");
188+
onServer = NO;
189+
}
185190

186191
if (onServer)
187192
{
@@ -206,12 +211,30 @@ - (void)setNewDeviceID:(NSString *)deviceID onServer:(BOOL)onServer
206211
[CountlyRemoteConfig.sharedInstance startRemoteConfig];
207212
}
208213

214+
- (void)setNewAppKey:(NSString *)newAppKey
215+
{
216+
if (!newAppKey.length)
217+
return;
218+
219+
[self suspend];
220+
221+
CountlyConnectionManager.sharedInstance.appKey = newAppKey;
222+
223+
[self resume];
224+
}
225+
209226
- (void)setCustomHeaderFieldValue:(NSString *)customHeaderFieldValue
210227
{
211228
CountlyConnectionManager.sharedInstance.customHeaderFieldValue = customHeaderFieldValue.copy;
212229
[CountlyConnectionManager.sharedInstance proceedOnQueue];
213230
}
214231

232+
- (void)flushQueues
233+
{
234+
[CountlyPersistency.sharedInstance flushEvents];
235+
[CountlyPersistency.sharedInstance flushQueue];
236+
}
237+
215238
#pragma mark ---
216239

217240
- (void)beginSession
@@ -593,35 +616,20 @@ - (void)crashLog:(NSString *)format, ...
593616
{
594617

595618
}
596-
597619
#endif
598620

599621

600622

601-
#pragma mark - APM
602-
603-
- (void)addExceptionForAPM:(NSString *)exceptionURL
604-
{
605-
[CountlyAPM.sharedInstance addExceptionForAPM:exceptionURL];
606-
}
607-
608-
- (void)removeExceptionForAPM:(NSString *)exceptionURL
609-
{
610-
[CountlyAPM.sharedInstance removeExceptionForAPM:exceptionURL];
611-
}
612-
613-
614-
615623
#pragma mark - View Tracking
616624

617625
- (void)recordView:(NSString *)viewName;
618626
{
619-
[CountlyViewTracking.sharedInstance startView:viewName];
627+
[CountlyViewTracking.sharedInstance startView:viewName customSegmentation:nil];
620628
}
621629

622-
- (void)reportView:(NSString *)viewName
630+
- (void)recordView:(NSString *)viewName segmentation:(NSDictionary *)segmentation
623631
{
624-
632+
[CountlyViewTracking.sharedInstance startView:viewName customSegmentation:segmentation];
625633
}
626634

627635
#if TARGET_OS_IOS
@@ -693,17 +701,17 @@ - (id)remoteConfigValueForKey:(NSString *)key
693701

694702
- (void)updateRemoteConfigWithCompletionHandler:(void (^)(NSError * error))completionHandler
695703
{
696-
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForForKeys:nil omitKeys:nil completionHandler:completionHandler];
704+
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForKeys:nil omitKeys:nil completionHandler:completionHandler];
697705
}
698706

699707
- (void)updateRemoteConfigOnlyForKeys:(NSArray *)keys completionHandler:(void (^)(NSError * error))completionHandler
700708
{
701-
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForForKeys:keys omitKeys:nil completionHandler:completionHandler];
709+
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForKeys:keys omitKeys:nil completionHandler:completionHandler];
702710
}
703711

704712
- (void)updateRemoteConfigExceptForKeys:(NSArray *)omitKeys completionHandler:(void (^)(NSError * error))completionHandler
705713
{
706-
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForForKeys:nil omitKeys:omitKeys completionHandler:completionHandler];
714+
[CountlyRemoteConfig.sharedInstance updateRemoteConfigForKeys:nil omitKeys:omitKeys completionHandler:completionHandler];
707715
}
708716

709717

Countly.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Countly'
3-
s.version = '19.02'
3+
s.version = '19.08'
44
s.license = {
55
:type => 'COMMUNITY',
66
:text => <<-LICENSE

0 commit comments

Comments
 (0)