Skip to content

Commit

Permalink
Updating underlying SDKs (#66)
Browse files Browse the repository at this point in the history
* Updating underlying SDKs

-- Replaced deprecated functions in iOS for present rating widget
-- Implement direct attribution for iOS also

* Update CHANGELOG.md

not relevant for Flutter

* updating recordIndirectAttribution with new calls in iOS SDK

Co-authored-by: ArtursKadikis <[email protected]>
  • Loading branch information
ijunaid and ArtursKadikis authored May 11, 2022
1 parent 65bdfbc commit 5857590
Show file tree
Hide file tree
Showing 22 changed files with 1,182 additions and 81 deletions.
31 changes: 20 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## 21.11.0
* !! Major breaking change !! Changing device ID without merging will now clear all consent. It has to be given again after this operation.
* !! Major breaking change !! Entering temporary ID mode will now clear all consent. It has to be given again after this operation.
* Added mitigations for potential push notification issue where some apps might be unable to display push notifications in their kill state.
* Added 'CountlyConfig' class for init time configurations.
* Added a way to retrieve feedback widget data and manually report them for iOS also
* Added Appear and dismiss callback for nps/survey widgets
* Added an optional 'onFinished' callback to 'getFeedbackWidgetData' method
* Added "getDeviceIDType" method to get current device id type
* Added "recordIndirectAttribution" method
* Added "recordDirectAttribution" method
* Added "setUserLocation" method to set user location
* Added platform information to push actioned events
* Fixed potential deadlock issue in Android.
* Fixed possible SecTrustCopyExceptions leak in iOS
* Fixed bug that occured when recording user profile values. Parameters not provided would be deleted from the server.
* Deprecated old init config methods. You should use the config object now. Those methods are:
- init
- manualSessionHandling
Expand All @@ -19,22 +33,17 @@
- enableCrashReporting
- setCustomCrashSegment
- enableApm
* Added a way to retrieve feedback widget data and manually report them for iOS also
* Added Appear and dismiss callback for nps/survey widgets
* Added an optional 'onFinished' callback to 'getFeedbackWidgetData' method
* Added "getDeviceIDType" method to get current device id type
* Added "recordIndirectAttribution" method
* Added "recordDirectAttribution" method (Currently supporterd only for Android)
* Added "setUserLocation" method to set user location
* Deprecated "setLocation" method
* Deprecated recordAttributionID method
* Deprecated enableAttribution method
* Deprecated 'askForFeedback' method. Added 'presentRatingWidgetWithID' method that should be used as it's replacement.
* Fixed bug that occured when recording user profile values. Parameters not provided would be deleted from the server.
* Added mitigations for potential push notification issue where some apps might be unable to display push notifications in their kill state.
* Device ID can now be changed when no consent is given
* Push notification now display/use the sent badge number in Android. It's visualization depends on the launcher.
* When recording internal events with 'recordEvent', the respective feature consent will now be checked instead of the 'events' consent.
* Consent changes will now send the whole consent state and not just the "delta"
* Updated minimum supported iOS versions to 10.0
* Updated underlying android SDK to 21.11.0-RC5
* Updated underlying iOS SDK to 21.11.1
* Updated underlying android SDK to 21.11.0
* Updated underlying iOS SDK to 21.11.2

## 20.11.4
* Moving a push related broadcast receiver declaration to the manifest to comply with 'PendingIntent' checks
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:21.11.0-RC5'
implementation 'ly.count.android:sdk:21.11.0'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
}
45 changes: 30 additions & 15 deletions ios/Classes/CountlyFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
}else if ([@"presentRatingWidgetWithID" isEqualToString:call.method]) {
dispatch_async(dispatch_get_main_queue(), ^ {
NSString* widgetId = [command objectAtIndex:0];
[Countly.sharedInstance presentFeedbackWidgetWithID:widgetId completionHandler:^(NSError* error){
[Countly.sharedInstance presentRatingWidgetWithID:widgetId completionHandler:^(NSError* error){

NSString* errorStr = nil;
if (error){
Expand Down Expand Up @@ -928,18 +928,27 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
NSException *e = [NSException exceptionWithName:@"Native Exception Crash!" reason:@"Throw Native Exception..." userInfo:nil];
@throw e;
});
}else if([@"recordIndirectAttribution" isEqualToString:call.method]) {
}else if([@"recordDirectAttribution" isEqualToString:call.method]) {
dispatch_async(dispatch_get_main_queue(), ^ {
NSString* campaignType = [command objectAtIndex:0];
NSString* campaignData = [command objectAtIndex:1];
if(CountlyCommon.sharedInstance.hasStarted) {
[Countly.sharedInstance recordDirectAttributionWithCampaignType:campaignType andCampaignData:campaignData];
}
else {
config.campaignType = campaignType;
config.campaignData = campaignData;
}
});
}
else if([@"recordIndirectAttribution" isEqualToString:call.method]) {
dispatch_async(dispatch_get_main_queue(), ^ {
NSDictionary* attributionValues = [command objectAtIndex:0];
NSString* IDFAKey = @"idfa";
NSString* attributionID = [attributionValues objectForKey:IDFAKey];
if (attributionID) {
if(CountlyCommon.sharedInstance.hasStarted) {
[Countly.sharedInstance recordAttributionID: attributionID];
}
else {
config.attributionID = attributionID;
}
if(CountlyCommon.sharedInstance.hasStarted) {
[Countly.sharedInstance recordIndirectAttribution: attributionValues];
}
else {
config.indirectAttribution = attributionValues;
}
});
}else if ([@"appLoadingFinished" isEqualToString:call.method]) {
Expand Down Expand Up @@ -1114,12 +1123,18 @@ - (void)populateConfig:(NSDictionary*)_config
if(ipAddress) {
config.IP = ipAddress;
}

NSString* campaignType = _config[@"campaignType"];
if(campaignType) {
config.campaignType = campaignType;
config.campaignData = _config[@"campaignData"];;
}

NSDictionary* attributionValues = _config[@"attributionValues"];
NSString* IDFAKey = @"idfa";
NSString* attributionID = [attributionValues objectForKey:IDFAKey];
if (attributionID) {
config.attributionID = attributionID;
if(attributionValues) {
config.indirectAttribution = attributionValues;
}

}
@catch(NSException *exception){
COUNTLY_FLUTTER_LOG(@"populateConfig, Unable to parse Config object: %@", exception);
Expand Down
Loading

0 comments on commit 5857590

Please sign in to comment.