Skip to content

Commit 9af00dd

Browse files
committed
android and ios update
1 parent ebb19f4 commit 9af00dd

File tree

10 files changed

+97
-27
lines changed

10 files changed

+97
-27
lines changed

CHANGELOG.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
## 25.4.0
2-
* Added `refreshContentZone()` method for probing content
3-
* Added `setSDKBehaviorSettings` init config method for providing server config settings
4-
* Added `disableBackoffMechanism` init config method for disabling request backoff logic
5-
* Added `disableSDKBehaviorSettingsUpdates` init config method for disabling server config sync requests
2+
* ! Minor breaking change ! The SDK now exclusively uses random UUIDs for device id generation instead of platform specific OpenUDID or IDFV.
3+
* ! Minor breaking change ! Server Configuration is now enabled by default. Changes made on SDK Manager > SDK Configuration on your server will affect SDK behavior directly.
4+
5+
* Added `refreshContentZone()` method for manual refresh of content zone
6+
* Added `disableBackoffMechanism()` init config method for disabling request backoff logic
7+
* Added `disableSDKBehaviorSettingsUpdates()` init config method for disabling server config sync requests
8+
* Added `setSDKBehaviorSettings(settingsObject: object)` init config method for providing server config settings
9+
* Added New Architecture (Turbo Modules) support
10+
* Added fullscreen support for feedback widgets
11+
* Added support for SDK health checks in iOS
12+
* Added a built-in backoff mechanism when server responses are slow
13+
14+
* Mitigated an issue that caused PN message data collision if two message with same ID was received in Android
15+
* Mitigated an issue that could occur while serializing events to improve stability, performance and memory usage in iOS
16+
* Mitigated an issue where the safe area resolution was not correctly calculated for the content zone on certain iOS devices.
17+
18+
* Updated the underlying Android SDK version to 25.4.1
19+
* Updated the underlying iOS SDK version to 25.4.2
620

721
## 25.1.2
822
* Mitigated an issue where the visibility tracking could have been enabled by default

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ repositories {
6565

6666
dependencies {
6767
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
68-
implementation 'ly.count.android:sdk:25.4.1'
68+
implementation 'ly.count.android:sdk:25.4.2'
6969

7070
// Import the BoM for the Firebase platform
7171
// The BoM version of 28.4.2 is the newest release that will target firebase-messaging version 22

ios/src/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 25.4.3
2+
* Mitigated an issue where SDK behavior settings were set to default when fetching for new config.
3+
* Mitigated an issue where latest fetched behavior settings were replacing the current settings instead of merging.
4+
15
## 25.4.2
26
* Added fullscreen support for feedback widgets.
37
* Added "disableSDKBehaviorSettingsUpdates" init config parameter to disable server config updates.

ios/src/Countly-PL.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-PL'
3-
s.version = '25.4.2'
3+
s.version = '25.4.3'
44
s.license = { :type => 'MIT', :file => 'LICENSE' }
55
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
66
s.homepage = 'https://github.com/Countly/countly-sdk-ios'

ios/src/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 = '25.4.2'
3+
s.version = '25.4.3'
44
s.license = { :type => 'MIT', :file => 'LICENSE' }
55
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
66
s.homepage = 'https://github.com/Countly/countly-sdk-ios'

ios/src/Countly.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@
768768
"@loader_path/Frameworks",
769769
);
770770
MACOSX_DEPLOYMENT_TARGET = 10.14;
771-
MARKETING_VERSION = 25.4.2;
771+
MARKETING_VERSION = 25.4.3;
772772
PRODUCT_BUNDLE_IDENTIFIER = ly.count.CountlyiOSSDK;
773773
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
774774
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -800,7 +800,7 @@
800800
"@loader_path/Frameworks",
801801
);
802802
MACOSX_DEPLOYMENT_TARGET = 10.14;
803-
MARKETING_VERSION = 25.4.2;
803+
MARKETING_VERSION = 25.4.3;
804804
PRODUCT_BUNDLE_IDENTIFIER = ly.count.CountlyiOSSDK;
805805
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
806806
PROVISIONING_PROFILE_SPECIFIER = "";

ios/src/CountlyCommon.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ @interface CountlyCommon ()
2929
#endif
3030
@end
3131

32-
NSString* const kCountlySDKVersion = @"25.4.2";
32+
NSString* const kCountlySDKVersion = @"25.4.3";
3333
NSString* const kCountlySDKName = @"objc-native-ios";
3434

3535
NSString* const kCountlyErrorDomain = @"ly.count.ErrorDomain";

ios/src/CountlyPersistency.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
- (NSDictionary *)retrieveRemoteConfig;
5959
- (void)storeRemoteConfig:(NSDictionary *)remoteConfig;
6060

61-
- (NSDictionary *)retrieveServerConfig;
62-
- (void)storeServerConfig:(NSDictionary *)serverConfig;
61+
- (NSMutableDictionary *)retrieveServerConfig;
62+
- (void)storeServerConfig:(NSMutableDictionary *)serverConfig;
6363

6464
- (NSDictionary *)retrieveHealthCheckTrackerState;
6565
- (void)storeHealthCheckTrackerState:(NSDictionary *)healthCheckTrackerState;

ios/src/CountlyPersistency.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,17 @@ - (void)storeRemoteConfig:(NSDictionary *)remoteConfig
593593
[NSUserDefaults.standardUserDefaults synchronize];
594594
}
595595

596-
- (NSDictionary *)retrieveServerConfig
596+
- (NSMutableDictionary *)retrieveServerConfig
597597
{
598598
NSDictionary* serverConfig = [NSUserDefaults.standardUserDefaults objectForKey:kCountlyServerConfigPersistencyKey];
599-
if (!serverConfig)
600-
serverConfig = NSDictionary.new;
601-
602-
return serverConfig;
599+
if ([serverConfig isKindOfClass:[NSDictionary class]]) {
600+
return [serverConfig mutableCopy];
601+
}
602+
603+
return [NSMutableDictionary new];
603604
}
604605

605-
- (void)storeServerConfig:(NSDictionary *)serverConfig
606+
- (void)storeServerConfig:(NSMutableDictionary *)serverConfig
606607
{
607608
[NSUserDefaults.standardUserDefaults setObject:serverConfig forKey:kCountlyServerConfigPersistencyKey];
608609
[NSUserDefaults.standardUserDefaults synchronize];

ios/src/CountlyServerConfig.m

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,66 @@ - (instancetype)init
116116

117117
- (void)retrieveServerConfigFromStorage:(NSString *)sdkBehaviorSettings
118118
{
119-
NSError *error = nil;
120-
NSDictionary *serverConfigObject = [CountlyPersistency.sharedInstance retrieveServerConfig];
121-
if (serverConfigObject.count == 0 && sdkBehaviorSettings)
119+
NSMutableDictionary *persistentBehaviorSettings = [CountlyPersistency.sharedInstance retrieveServerConfig];
120+
if (persistentBehaviorSettings.count == 0 && sdkBehaviorSettings)
122121
{
123-
serverConfigObject = [NSJSONSerialization JSONObjectWithData:[sdkBehaviorSettings cly_dataUTF8] options:0 error:&error];
122+
NSError *error = nil;
123+
id parsed = [NSJSONSerialization JSONObjectWithData:[sdkBehaviorSettings cly_dataUTF8] options:0 error:&error];
124+
125+
if ([parsed isKindOfClass:[NSDictionary class]]) {
126+
persistentBehaviorSettings = [(NSDictionary *)parsed mutableCopy];
127+
[CountlyPersistency.sharedInstance storeServerConfig:persistentBehaviorSettings];
128+
} else {
129+
CLY_LOG_W(@"%s, Failed to parse sdkBehaviorSettings or not a dictionary: %@", __FUNCTION__, error);
130+
}
124131
}
125132

126-
if (serverConfigObject.count > 0 && !error)
133+
[self populateServerConfig:persistentBehaviorSettings];
134+
}
135+
136+
- (void)mergeBehaviorSettings:(NSMutableDictionary *)baseConfig
137+
withConfig:(NSDictionary *)newConfig
138+
{
139+
// c, t and v paramters must exist
140+
if(newConfig.count != 3 || !newConfig[kRConfig]) {
141+
CLY_LOG_D(@"%s, missing entries for a behavior settings omitting", __FUNCTION__);
142+
return;
143+
}
144+
145+
if (!newConfig[kRVersion] || !newConfig[kRTimestamp])
127146
{
128-
[self populateServerConfig:serverConfigObject];
147+
CLY_LOG_D(@"%s, version or timestamp is missing in the behavioır settings omitting", __FUNCTION__);
148+
return;
149+
}
150+
151+
if(!([newConfig[kRConfig] isKindOfClass:[NSDictionary class]]) || ((NSDictionary *)newConfig[kRConfig]).count == 0){
152+
CLY_LOG_D(@"%s, invalid behavior settings omitting", __FUNCTION__);
153+
return;
154+
}
155+
156+
id timestamp = newConfig[kRTimestamp];
157+
if (timestamp) {
158+
baseConfig[kRTimestamp] = timestamp;
159+
}
160+
161+
id version = newConfig[kRVersion];
162+
if (version) {
163+
baseConfig[kRVersion] = version;
164+
}
165+
166+
NSDictionary *cBase = baseConfig[kRConfig] ?: NSMutableDictionary.new;
167+
NSDictionary *cNew = newConfig[kRConfig];
168+
169+
if ([cBase isKindOfClass:[NSDictionary class]] || [cNew isKindOfClass:[NSDictionary class]]) {
170+
NSMutableDictionary *cMerged = [cBase mutableCopy];
171+
172+
[cNew enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
173+
if (obj != nil && obj != [NSNull null]) {
174+
cMerged[key] = obj;
175+
}
176+
}];
177+
178+
baseConfig[kRConfig] = cMerged;
129179
}
130180
}
131181

@@ -379,9 +429,10 @@ - (void)fetchServerConfig:(CountlyConfig *)config
379429

380430
if (serverConfigResponse[kRConfig] != nil)
381431
{
382-
[CountlyPersistency.sharedInstance storeServerConfig:serverConfigResponse];
383-
[self setDefaultValues];
384-
[self populateServerConfig:serverConfigResponse];
432+
NSMutableDictionary *persistentBehaviorSettings = [CountlyPersistency.sharedInstance retrieveServerConfig];
433+
[self mergeBehaviorSettings:persistentBehaviorSettings withConfig:serverConfigResponse];
434+
[CountlyPersistency.sharedInstance storeServerConfig:persistentBehaviorSettings];
435+
[self populateServerConfig:persistentBehaviorSettings];
385436
}
386437

387438
[self notifySdkConfigChange:config]; // if no config let stored ones to be set

0 commit comments

Comments
 (0)