Skip to content

Commit

Permalink
Updated SDK version to 23.2.3 (#103)
Browse files Browse the repository at this point in the history
* Updated SDK version to 23.2.3

- Updated Underlying android SDK version to 22.09.4
- Updated Underlying iOS SDK version to 23.02.2
- Updated Changelog

* removed iOS extra file

* fixed android duplicate class issue

* Update CHANGELOG.md

---------

Co-authored-by: ArtursKadikis <[email protected]>
  • Loading branch information
ijunaid and ArtursKadikis authored Apr 27, 2023
1 parent 351048e commit 49ed791
Show file tree
Hide file tree
Showing 22 changed files with 283 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 23.2.3
* Not reporting battery level in the crash handler to prevent hanging in iOS
* Fixing bug that prevented device ID to be changed when there is no consent given in Android
* Updated Underlying android SDK version to 22.09.4
* Updated Underlying iOS SDK version to 23.02.2

## 23.2.3-np
* Not reporting battery level in the crash handler to prevent hanging in iOS
* Fixing bug that prevented device ID to be changed when there is no consent given in Android
* Updated Underlying android SDK version to 22.09.4
* Updated Underlying iOS SDK version to 23.02.2

## 23.2.2
* Added "previous event ID" logic for non-internal events
* Session update interval upper limit (10 minutes) has been lifted in Android
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ android {
}

dependencies {
implementation 'ly.count.android:sdk:22.09.3'
implementation 'ly.count.android:sdk:22.09.4'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
}
2 changes: 1 addition & 1 deletion example-no-push/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'ly.count.android:sdk:22.09.3'
implementation 'ly.count.android:sdk:22.09.4'
}

3 changes: 2 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'ly.count.android:sdk:22.09.3'
implementation 'ly.count.android:sdk:22.09.4'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
}
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin

4 changes: 4 additions & 0 deletions ios/Classes/CountlyiOS/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 23.02.2
- Added server configuration functionality. This is an experimental feature.
- Not reporting battery level in the crash handler to prevent hanging

## 23.02.1
- Added previous event ID and sending it with custom events.
- Updated default `maxSegmentationValues` from 30 to 100
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyiOS/Countly-PL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Countly-PL'
s.version = '23.02.1'
s.version = '23.02.2'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-ios'
Expand Down
8 changes: 8 additions & 0 deletions ios/Classes/CountlyiOS/Countly.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ - (void)startWithConfig:(CountlyConfig *)config
CountlyDeviceInfo.sharedInstance.customMetrics = [config.customMetrics cly_truncated:@"Custom metric"];

[Countly.user save];

CountlyCommon.sharedInstance.enableServerConfiguration = config.enableServerConfiguration;

// Fetch server configs if 'enableServerConfiguration' is true.
if(config.enableServerConfiguration)
{
[CountlyServerConfig.sharedInstance fetchServerConfig];
}

#if (TARGET_OS_IOS)
CountlyFeedbacks.sharedInstance.message = config.starRatingMessage;
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyiOS/Countly.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Countly'
s.version = '23.02.1'
s.version = '23.02.2'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-ios'
Expand Down
3 changes: 3 additions & 0 deletions ios/Classes/CountlyiOS/CountlyCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#import "CountlyLocationManager.h"
#import "CountlyRemoteConfig.h"
#import "CountlyPerformanceMonitoring.h"
#import "CountlyServerConfig.h"

#define CLY_LOG_E(fmt, ...) CountlyInternalLog(CLYInternalLogLevelError, fmt, ##__VA_ARGS__)
#define CLY_LOG_W(fmt, ...) CountlyInternalLog(CLYInternalLogLevelWarning, fmt, ##__VA_ARGS__)
Expand Down Expand Up @@ -57,6 +58,7 @@ NS_ERROR_ENUM(kCountlyErrorDomain)
CLYErrorFeedbackWidgetNotTargetedForDevice = 10002,
CLYErrorRemoteConfigGeneralAPIError = 10011,
CLYErrorFeedbacksGeneralAPIError = 10012,
CLYErrorServerConfigGeneralAPIError = 10013,
};

@interface CountlyCommon : NSObject
Expand All @@ -72,6 +74,7 @@ NS_ERROR_ENUM(kCountlyErrorDomain)
@property (nonatomic, copy) NSString* attributionID;
@property (nonatomic) BOOL manualSessionHandling;
@property (nonatomic) BOOL enableOrientationTracking;
@property (nonatomic) BOOL enableServerConfiguration;


@property (nonatomic) NSUInteger maxKeyLength;
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyiOS/CountlyCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ @interface CountlyCommon ()
#endif
@end

NSString* const kCountlySDKVersion = @"23.02.1";
NSString* const kCountlySDKVersion = @"23.02.2";
NSString* const kCountlySDKName = @"objc-native-ios";

NSString* const kCountlyErrorDomain = @"ly.count.ErrorDomain";
Expand Down
7 changes: 7 additions & 0 deletions ios/Classes/CountlyiOS/CountlyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,13 @@ typedef enum : NSUInteger
* @discussion For disabling it, please set this flag to @c NO.
*/
@property (nonatomic) BOOL enableOrientationTracking;

/**
* This is an experimental feature
* For enabling fetching and application of server config values.
* @discussion If set, Server Config values from Countly Server will be fetched at the beginning of a session.
*/
@property (nonatomic) BOOL enableServerConfiguration;
NS_ASSUME_NONNULL_END

@end
1 change: 1 addition & 0 deletions ios/Classes/CountlyiOS/CountlyConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ - (instancetype)init
self.internalLogLevel = CLYInternalLogLevelDebug;

self.enableOrientationTracking = YES;
self.enableServerConfiguration = NO;
}

return self;
Expand Down
12 changes: 12 additions & 0 deletions ios/Classes/CountlyiOS/CountlyConnectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ - (void)setURLSessionConfiguration:(NSURLSessionConfiguration *)URLSessionConfig
- (void)proceedOnQueue
{
CLY_LOG_D(@"Proceeding on queue...");

if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"Proceeding on queue is aborted: SDK Networking is disabled from server config!");
return;
}

if (self.connection)
{
Expand Down Expand Up @@ -364,6 +370,12 @@ - (void)sendUserDetails:(NSString *)userDetails

- (void)sendCrashReport:(NSString *)report immediately:(BOOL)immediately;
{
if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"'sendCrashReport' is aborted: SDK Networking is disabled from server config!");
return;
}

if (!report)
{
CLY_LOG_W(@"Crash report is nil. Converting to JSON may have failed due to custom objects in initial config's crashSegmentation property.");
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyiOS/CountlyCrashReporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void CountlyExceptionHandler(NSException *exception, bool isFatal, bool isAutoDe
crashReport[kCountlyCRKeyRAMTotal] = @(CountlyDeviceInfo.totalRAM / kCLYMebibit);
crashReport[kCountlyCRKeyDiskCurrent] = @((CountlyDeviceInfo.totalDisk - CountlyDeviceInfo.freeDisk) / kCLYMebibit);
crashReport[kCountlyCRKeyDiskTotal] = @(CountlyDeviceInfo.totalDisk / kCLYMebibit);
crashReport[kCountlyCRKeyBattery] = @(CountlyDeviceInfo.batteryLevel);
//crashReport[kCountlyCRKeyBattery] = @(CountlyDeviceInfo.batteryLevel);//not reporting this to prevent hanging in the middle of crash reporting
crashReport[kCountlyCRKeyOrientation] = CountlyDeviceInfo.orientation;
crashReport[kCountlyCRKeyOnline] = @((CountlyDeviceInfo.connectionType) ? 1 : 0 );
crashReport[kCountlyCRKeyRoot] = @(CountlyDeviceInfo.isJailbroken);
Expand Down
6 changes: 6 additions & 0 deletions ios/Classes/CountlyiOS/CountlyFeedbackWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ - (void)presentWithAppearBlock:(void(^ __nullable)(void))appearBlock andDismissB
- (void)getWidgetData:(void (^)(NSDictionary * __nullable widgetData, NSError * __nullable error))completionHandler
{
CLY_LOG_I(@"%s %@", __FUNCTION__, completionHandler);

if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"'getWidgetData' is aborted: SDK Networking is disabled from server config!");
return;
}

NSURLSessionTask* task = [NSURLSession.sharedSession dataTaskWithRequest:[self dataRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
Expand Down
12 changes: 12 additions & 0 deletions ios/Classes/CountlyiOS/CountlyFeedbacks.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ - (UIColor *)passiveStarColor

- (void)checkFeedbackWidgetWithID:(NSString *)widgetID completionHandler:(void (^)(NSError * error))completionHandler
{
if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"'checkFeedbackWidgetWithID' is aborted: SDK Networking is disabled from server config!");
return;
}

if (!CountlyConsentManager.sharedInstance.consentForFeedback)
return;

Expand Down Expand Up @@ -401,6 +407,12 @@ - (void)recordRatingWidgetWithID:(NSString *)widgetID rating:(NSInteger)rating e

- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> *feedbackWidgets, NSError *error))completionHandler
{
if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"'getFeedbackWidgets' is aborted: SDK Networking is disabled from server config!");
return;
}

if (!CountlyConsentManager.sharedInstance.consentForFeedback)
return;

Expand Down
3 changes: 3 additions & 0 deletions ios/Classes/CountlyiOS/CountlyPersistency.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
- (NSDictionary *)retrieveRemoteConfig;
- (void)storeRemoteConfig:(NSDictionary *)remoteConfig;

- (NSDictionary *)retrieveServerConfig;
- (void)storeServerConfig:(NSDictionary *)serverConfig;

@property (nonatomic) NSUInteger eventSendThreshold;
@property (nonatomic) NSUInteger storedRequestsLimit;
@property (nonatomic, readonly) BOOL isQueueBeingModified;
Expand Down
23 changes: 23 additions & 0 deletions ios/Classes/CountlyiOS/CountlyPersistency.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ @implementation CountlyPersistency
NSString* const kCountlyNotificationPermissionKey = @"kCountlyNotificationPermissionKey";
NSString* const kCountlyIsCustomDeviceIDKey = @"kCountlyIsCustomDeviceIDKey";
NSString* const kCountlyRemoteConfigPersistencyKey = @"kCountlyRemoteConfigPersistencyKey";
NSString* const kCountlyServerConfigPersistencyKey = @"kCountlyServerConfigPersistencyKey";


NSString* const kCountlyCustomCrashLogFileName = @"CountlyCustomCrash.log";

Expand Down Expand Up @@ -69,6 +71,12 @@ - (instancetype)init

- (void)addToQueue:(NSString *)queryString
{
if(!CountlyServerConfig.sharedInstance.trackingEnabled)
{
CLY_LOG_D(@"'addToQueue' is aborted: SDK Tracking is disabled from server config!");
return;
}

if (!queryString.length || [queryString isEqual:NSNull.null])
return;

Expand Down Expand Up @@ -500,4 +508,19 @@ - (void)storeRemoteConfig:(NSDictionary *)remoteConfig
[NSUserDefaults.standardUserDefaults synchronize];
}

- (NSDictionary *)retrieveServerConfig
{
NSDictionary* serverConfig = [NSUserDefaults.standardUserDefaults objectForKey:kCountlyServerConfigPersistencyKey];
if (!serverConfig)
serverConfig = NSDictionary.new;

return serverConfig;
}

- (void)storeServerConfig:(NSDictionary *)serverConfig
{
[NSUserDefaults.standardUserDefaults setObject:serverConfig forKey:kCountlyServerConfigPersistencyKey];
[NSUserDefaults.standardUserDefaults synchronize];
}

@end
5 changes: 5 additions & 0 deletions ios/Classes/CountlyiOS/CountlyRemoteConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ - (void)clearCachedRemoteConfig

- (void)fetchRemoteConfigForKeys:(NSArray *)keys omitKeys:(NSArray *)omitKeys completionHandler:(void (^)(NSDictionary* remoteConfig, NSError * error))completionHandler
{
if (!CountlyServerConfig.sharedInstance.networkingEnabled)
{
CLY_LOG_D(@"'fetchRemoteConfigForKeys' is aborted: SDK Networking is disabled from server config!");
return;
}
if (!completionHandler)
return;

Expand Down
19 changes: 19 additions & 0 deletions ios/Classes/CountlyiOS/CountlyServerConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// CountlyServerConfig.h
//
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.

#import <Foundation/Foundation.h>

@interface CountlyServerConfig : NSObject
#if (TARGET_OS_IOS)
+ (instancetype)sharedInstance;

- (void)fetchServerConfig;

@property (nonatomic) BOOL trackingEnabled;
@property (nonatomic) BOOL networkingEnabled;
#endif
@end

Loading

0 comments on commit 49ed791

Please sign in to comment.