Skip to content

Commit

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

* Updated Underlying android SDK version to 22.09.3
* Updated Underlying iOS SDK version to 23.02.1

* ios example podfile lock version updated

* increased maxSegmentationValues to 100

* iOS sdk changelog updated

* updated changelog for iOS

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: ArtursKadikis <[email protected]>
  • Loading branch information
ijunaid and ArtursKadikis authored Apr 11, 2023
1 parent 3c0b23b commit 351048e
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 36 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 23.2.2
* Added "previous event ID" logic for non-internal events
* Session update interval upper limit (10 minutes) has been lifted in Android
* Updated default maxSegmentationValues from 30 to 100 for iOS
* Updated Underlying android SDK version to 22.09.3
* Updated Underlying iOS SDK version to 23.02.1

## 23.2.2-np
* Added "previous event ID" logic for non-internal events
* Session update interval upper limit (10 minutes) has been lifted in Android
* Updated default maxSegmentationValues from 30 to 100 for iOS
* Updated Underlying android SDK version to 22.09.3
* Updated Underlying iOS SDK version to 23.02.1

## 23.2.1
* Fixed a bug in Android where metric override values were not applying to crash metrics Fixed a bug where crash metrics sent the "manufacturer" value under the wrong key
* Fixed a bug in Android where orientation events would have the same view ID as the previous view event
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.1'
implementation 'ly.count.android:sdk:22.09.3'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*/
public class CountlyFlutterPlugin implements MethodCallHandler, FlutterPlugin, ActivityAware, DefaultLifecycleObserver {
private static final String TAG = "CountlyFlutterPlugin";
private final String COUNTLY_FLUTTER_SDK_VERSION_STRING = "23.2.1";
private final String COUNTLY_FLUTTER_SDK_VERSION_STRING = "23.2.2";
private final String COUNTLY_FLUTTER_SDK_NAME = "dart-flutterb-android";
private final String COUNTLY_FLUTTER_SDK_NAME_NO_PUSH = "dart-flutterbnp-android";

Expand Down
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.1'
implementation 'ly.count.android:sdk:22.09.3'
}

2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ 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.1'
implementation 'ly.count.android:sdk:22.09.3'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
}
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- countly_flutter (23.2.1):
- countly_flutter (23.2.2):
- Flutter
- Flutter (1.0.0)

Expand All @@ -14,7 +14,7 @@ EXTERNAL SOURCES:
:path: Flutter

SPEC CHECKSUMS:
countly_flutter: 7f716cfa98918f50ecd38a6b705ac581d573d977
countly_flutter: 78a293ba08c1aed6fc88a162dfcbcae8e31312d5
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ + (CountlyFeedbackWidget *)createWithDictionary:(NSDictionary *)dictionary;

CLYPushTestMode const CLYPushTestModeProduction = @"CLYPushTestModeProduction";

NSString *const kCountlyFlutterSDKVersion = @"23.2.1";
NSString *const kCountlyFlutterSDKVersion = @"23.2.2";
NSString *const kCountlyFlutterSDKName = @"dart-flutterb-ios";
NSString *const kCountlyFlutterSDKNameNoPush = @"dart-flutterbnp-ios";

Expand Down
6 changes: 4 additions & 2 deletions ios/Classes/CountlyiOS/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
## 23.02.1
- Added previous event ID and sending it with custom events.
- Updated default `maxSegmentationValues` from 30 to 100

## 23.02.0
- Added event IDs
- Added current and previous view IDs to events
- Added sending pending events before sending user details on `save` call.



## 22.09.0
- Deleted previously deprecated `userLoggedIn:` and `userLoggedOut` methods
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.0'
s.version = '23.02.1'
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
44 changes: 31 additions & 13 deletions ios/Classes/CountlyiOS/Countly.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ @interface Countly ()
@end

long long appLoadStartTime;
// It holds the event id of previous recorded custom event.
NSString* previousEventID;

@implementation Countly

Expand Down Expand Up @@ -603,23 +605,13 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co
{
CLY_LOG_I(@"%s %@ %@ %lu %f %f", __FUNCTION__, key, segmentation, (unsigned long)count, sum, duration);

NSDictionary <NSString *, NSNumber *>* reservedEvents =
@{
kCountlyReservedEventOrientation: @(CountlyConsentManager.sharedInstance.consentForUserDetails),
kCountlyReservedEventStarRating: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventSurvey: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventNPS: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventPushAction: @(CountlyConsentManager.sharedInstance.consentForPushNotifications),
kCountlyReservedEventView: @(CountlyConsentManager.sharedInstance.consentForViewTracking),
};

NSNumber* aReservedEvent = reservedEvents[key];
BOOL isReservedEvent = [self isReservedEvent:key];

if (aReservedEvent)
if (isReservedEvent)
{
CLY_LOG_V(@"A reserved event detected: %@", key);

if (!aReservedEvent.boolValue)
if (!isReservedEvent)
{
CLY_LOG_W(@"Specific consent not given for the reserved event! So, it will not be recorded.");
return;
Expand Down Expand Up @@ -677,6 +669,16 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co
event.CVID = CountlyViewTracking.sharedInstance.currentViewID ?: @"";
}

// Check if the event is a reserved event
BOOL isReservedEvent = [self isReservedEvent:key];

// If the event is not reserved, assign the previous event ID to the current event's PEID property, or an empty string if previousEventID is nil. Then, update previousEventID to the current event's ID.
if(!isReservedEvent)
{
event.PEID = previousEventID ?: @"";
previousEventID = event.ID;
}

event.segmentation = segmentation;
event.count = MAX(count, 1);
event.sum = sum;
Expand All @@ -688,6 +690,22 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co
[CountlyPersistency.sharedInstance recordEvent:event];
}

- (BOOL)isReservedEvent:(NSString *)key
{
NSDictionary <NSString *, NSNumber *>* reservedEvents =
@{
kCountlyReservedEventOrientation: @(CountlyConsentManager.sharedInstance.consentForUserDetails),
kCountlyReservedEventStarRating: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventSurvey: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventNPS: @(CountlyConsentManager.sharedInstance.consentForFeedback),
kCountlyReservedEventPushAction: @(CountlyConsentManager.sharedInstance.consentForPushNotifications),
kCountlyReservedEventView: @(CountlyConsentManager.sharedInstance.consentForViewTracking),
};

NSNumber* aReservedEvent = reservedEvents[key];
return aReservedEvent.boolValue;
}

#pragma mark -

- (void)startEvent:(NSString *)key
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.0'
s.version = '23.02.1'
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
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.0";
NSString* const kCountlySDKVersion = @"23.02.1";
NSString* const kCountlySDKName = @"objc-native-ios";

NSString* const kCountlyErrorDomain = @"ly.count.ErrorDomain";
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CountlyiOS/CountlyConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (instancetype)init

self.maxKeyLength = 128;
self.maxValueLength = 256;
self.maxSegmentationValues = 30;
self.maxSegmentationValues = 100;

self.location = kCLLocationCoordinate2DInvalid;

Expand Down
1 change: 1 addition & 0 deletions ios/Classes/CountlyiOS/CountlyEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@property (nonatomic, copy) NSString* ID;
@property (nonatomic, copy) NSString* CVID;
@property (nonatomic, copy) NSString* PVID;
@property (nonatomic, copy) NSString* PEID;
@property (nonatomic, copy) NSDictionary* segmentation;
@property (nonatomic) NSUInteger count;
@property (nonatomic) double sum;
Expand Down
6 changes: 5 additions & 1 deletion ios/Classes/CountlyiOS/CountlyEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ @implementation CountlyEvent
NSString* const kCountlyEventKeyID = @"id";
NSString* const kCountlyEventKeyCVID = @"cvid";
NSString* const kCountlyEventKeyPVID = @"pvid";
NSString* const kCountlyEventKeyPEID = @"peid";
NSString* const kCountlyEventKeySegmentation = @"segmentation";
NSString* const kCountlyEventKeyCount = @"count";
NSString* const kCountlyEventKeySum = @"sum";
Expand All @@ -31,6 +32,7 @@ - (NSDictionary *)dictionaryRepresentation
eventData[kCountlyEventKeyID] = self.ID;
eventData[kCountlyEventKeyCVID] = self.CVID;
eventData[kCountlyEventKeyPVID] = self.PVID;
eventData[kCountlyEventKeyPEID] = self.PEID;
eventData[kCountlyEventKeyCount] = @(self.count);
eventData[kCountlyEventKeySum] = @(self.sum);
eventData[kCountlyEventKeyTimestamp] = @((long long)(self.timestamp * 1000));
Expand All @@ -48,6 +50,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder
self.ID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(ID))];
self.CVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(CVID))];
self.PVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PVID))];
self.PEID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PEID))];
self.segmentation = [decoder decodeObjectForKey:NSStringFromSelector(@selector(segmentation))];
self.count = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(count))];
self.sum = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(sum))];
Expand All @@ -56,7 +59,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder
self.dayOfWeek = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(dayOfWeek))];
self.duration = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(duration))];
}

return self;
}

Expand All @@ -66,6 +69,7 @@ - (void)encodeWithCoder:(NSCoder *)encoder
[encoder encodeObject:self.ID forKey:NSStringFromSelector(@selector(ID))];
[encoder encodeObject:self.CVID forKey:NSStringFromSelector(@selector(CVID))];
[encoder encodeObject:self.PVID forKey:NSStringFromSelector(@selector(PVID))];
[encoder encodeObject:self.PEID forKey:NSStringFromSelector(@selector(PEID))];
[encoder encodeObject:self.segmentation forKey:NSStringFromSelector(@selector(segmentation))];
[encoder encodeInteger:self.count forKey:NSStringFromSelector(@selector(count))];
[encoder encodeDouble:self.sum forKey:NSStringFromSelector(@selector(sum))];
Expand Down
7 changes: 3 additions & 4 deletions ios/Classes/CountlyiOS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ and [desktop](https://count.ly/desktop-analytics) applications. [Ensuring privac

Track, measure, and take action - all without leaving Countly.

* **Slack user?** [Join our Slack Community](https://slack.count.ly)
* **Questions or feature requests?** [Post in our Community Forum](https://support.count.ly/hc/en-us/community/topics)
* **Questions or feature requests?** [Join the Countly Community on Discord](https://discord.gg/countly)
* **Looking for the Countly Server?** [Countly Community Edition repository](https://github.com/Countly/countly-server)
* **Looking for other Countly SDKs?** [An overview of all Countly SDKs for mobile, web and desktop](https://support.count.ly/hc/en-us/articles/360037236571-Downloading-and-Installing-SDKs#officially-supported-sdks)

Expand Down Expand Up @@ -53,6 +52,6 @@ If you like Countly, [why not use one of our badges](https://count.ly/brand-asse
```

## How can I help you with your efforts?
Glad you asked! We need ideas, feedback and constructive comments. All your suggestions will be taken care of with utmost importance. For feature requests and engaging with the community, join [our Slack Community](https://slack.count.ly) or [Community Forum](https://support.count.ly/hc/en-us/community/topics).
Glad you asked! For community support, feature requests, and engaging with the Countly Community, please join us at [our Discord Server](https://discord.gg/countly). We're excited to have you there!

We are on [Twitter](http://twitter.com/gocountly), [Facebook](https://www.facebook.com/Countly) and [LinkedIn](https://www.linkedin.com/company/countly) if you would like to keep up with Countly related updates.
Also, we are on [Twitter](https://twitter.com/gocountly) and [LinkedIn](https://www.linkedin.com/company/countly) if you would like to keep up with Countly related updates.
2 changes: 1 addition & 1 deletion ios/countly_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'countly_flutter'
s.version = '23.2.1'
s.version = '23.2.2'
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-flutter-bridge'
s.social_media_url = 'https://twitter.com/gocountly'
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: countly_flutter
description: Countly is an innovative, real-time, open source mobile analytics and push notifications platform.
version: 23.2.1
version: 23.2.2
homepage: https://support.count.ly/hc/en-us/articles/360037944212-Flutter

environment:
Expand Down
2 changes: 1 addition & 1 deletion scripts/no-push-files/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ android {
}

dependencies {
implementation 'ly.count.android:sdk:22.09.1'
implementation 'ly.count.android:sdk:22.09.3'
}
2 changes: 1 addition & 1 deletion scripts/no-push-files/countly_flutter_np.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'countly_flutter_np'
s.version = '23.2.1'
s.version = '23.2.2'
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-flutter-bridge'
s.social_media_url = 'https://twitter.com/gocountly'
Expand Down
2 changes: 1 addition & 1 deletion scripts/no-push-files/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: countly_flutter_np
description: Countly is an innovative, real-time, open source mobile analytics. This plugin is a flavour of the SDK without push notifications.
version: 23.2.1
version: 23.2.2
homepage: https://support.count.ly/hc/en-us/articles/360037944212-Flutter

environment:
Expand Down

0 comments on commit 351048e

Please sign in to comment.