Skip to content

Commit

Permalink
Merge pull request #98 from CleverTap/develop
Browse files Browse the repository at this point in the history
SDK-622: Release v3.9.2
  • Loading branch information
Aditi3 authored Feb 5, 2021
2 parents 20ff17a + b3a1e86 commit ecf3582
Show file tree
Hide file tree
Showing 11 changed files with 237 additions and 169 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "\U0001F41E Bug report"
about: Report a bug or regression to help us improve
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See an error

This could be a description, debug logs/console output, etc. You can also share a demo project with us where the issue is reproducible.

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- Xcode version: [e.g. Xcode 11.x, Xcode 12.x]
- CleverTap SDK Version: [e.g. vx.x.x]
- Device: [e.g. iPhone12, iPhone7]
- OS: [e.g. iOS 13.3]

**Possible Solution**
Suggest a fix

**Additional context**
Add any other context about the problem here.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "\U0001F680 Feature request"
about: Suggest an idea, propose improvement, start discussion or put a feature request for the CleverTap iOS SDK
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.

### [Version 3.9.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/3.9.2) (February 5, 2021)

##### Fixed
- Removes unknown JSON attributes while handling Test In-App Notification, Test App Inbox or Test Display Unit
- Makes `model` property `atomic` (thread-safe)
- Minor Performance improvements

### [Version 3.9.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/3.9.1) (October 8, 2020)

##### Added
Expand Down
2 changes: 1 addition & 1 deletion CleverTap-iOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CleverTap-iOS-SDK"
s.version = "3.9.1"
s.version = "3.9.2"
s.summary = "The CleverTap iOS SDK for App Analytics and Engagement."
s.homepage = "https://github.com/CleverTap/clevertap-ios-sdk"
s.license = { :type => "MIT" }
Expand Down
2 changes: 1 addition & 1 deletion CleverTapSDK/CTDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@property (strong, readonly) NSString *osName;
@property (strong, readonly) NSString *osVersion;
@property (strong, readonly) NSString *manufacturer;
@property (strong, readonly) NSString *model;
@property (atomic, readonly) NSString *model;
@property (strong, readonly) NSString *carrier;
@property (strong, readonly) NSString *countryCode;
@property (strong, readonly) NSString *timeZone;
Expand Down
38 changes: 28 additions & 10 deletions CleverTapSDK/CleverTap.m
Original file line number Diff line number Diff line change
Expand Up @@ -1496,19 +1496,12 @@ - (void)_handlePushNotification:(id)object openDeepLinksInForeground:(BOOL)openI

CleverTapLogDebug(self.config.logLevel, @"%@: handling push notification: %@", self, notification);

// check to see whether the push includes a test in-app notification, if so don't process further
if ([self didHandleInAppTestFromPushNotificaton:notification]) return;

// check to see whether the push includes a test inbox message, if so don't process further
if ([self didHandleInboxMessageTestFromPushNotificaton:notification]) return;

// check to see whether the push includes a test display unit, if so don't process further
if ([self didHandleDisplayUnitTestFromPushNotificaton:notification]) return;
// check to see whether the push includes a test in-app notification, test inbox message or test display unit, if so don't process further
if ([self _checkAndHandleTestPushPayload:notification]) return;

// notify application with push notification custom extras
[self _notifyPushNotificationTapped:notification];


dispatch_async(dispatch_get_main_queue(), ^{
// determine application state
UIApplication *application = [[self class] getSharedApplication];
Expand Down Expand Up @@ -1539,6 +1532,31 @@ - (void)_handlePushNotification:(id)object openDeepLinksInForeground:(BOOL)openI
#endif
}

#if !defined(CLEVERTAP_TVOS)
- (BOOL)_checkAndHandleTestPushPayload:(NSDictionary *)notification {
if (notification[@"wzrk_inapp"] || notification[@"wzrk_inbox"] || notification[@"wzrk_adunit"]) {
// remove unknown json attributes
NSMutableDictionary *testPayload = [NSMutableDictionary new];
for (NSString *key in [notification allKeys]) {
if ([CTUtils doesString:key startWith:CLTAP_NOTIFICATION_TAG] || [CTUtils doesString:key startWith:CLTAP_NOTIFICATION_TAG_SECONDARY]) {
testPayload[key] = notification[key];
}
}
if ([self didHandleInAppTestFromPushNotificaton:testPayload]) {
return YES;
} else if ([self didHandleInboxMessageTestFromPushNotificaton:testPayload]) {
return YES;
} else if ([self didHandleDisplayUnitTestFromPushNotificaton:testPayload]) {
return YES;
} else {
CleverTapLogDebug(self.config.logLevel, @"%@: unable to handle test payload in the push notification: %@", self, notification);
return NO;
}
}
return NO;
}
#endif

- (void)_notifyPushNotificationTapped:(NSDictionary *)notification {
if (self.pushNotificationDelegate && [self.pushNotificationDelegate respondsToSelector:@selector(pushNotificationTappedWithCustomExtras:)]) {
NSMutableDictionary *mutableNotification = [NSMutableDictionary dictionaryWithDictionary:notification];
Expand Down Expand Up @@ -2095,7 +2113,7 @@ - (void)updateARP:(NSDictionary *)arp {
}
}
[self saveARP:update];
[self processDiscardedEventsRequest:arp];
[self processDiscardedEventsRequest:update];
[self.productConfig updateProductConfigWithOptions:[self _setProductConfig:arp]];
}

Expand Down
2 changes: 1 addition & 1 deletion CleverTapSDK/CleverTapBuildInfo.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

#define WR_SDK_REVISION @"30901"
#define WR_SDK_REVISION @"30902"
6 changes: 3 additions & 3 deletions CleverTapSDK/Inbox/controllers/CTInboxController.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ - (void)updateMessages:(NSArray<NSDictionary*> *)messages {
CleverTapLogStaticInternal(@"%@: updating messages: %@", self.user, messages);
BOOL haveUpdates = [self.user updateMessages:messages forContext:privateContext];
if (haveUpdates) {
[self notifyUpdate];
[self _save];
[self notifyUpdate];
}
}];
}
Expand All @@ -104,8 +104,8 @@ - (void)markReadMessageWithId:(NSString *)messageId {
CTMessageMO *message = [self _messageForId:messageId];
if (message) {
[message setValue:@YES forKey:@"isRead"];
[self notifyUpdate];
[self _save];
[self notifyUpdate];
}
}];
}
Expand Down Expand Up @@ -191,8 +191,8 @@ - (void)_deleteMessages:(NSArray<CTMessageMO*>*)messages {
for (CTMessageMO *msg in messages) {
[privateContext deleteObject:msg];
}
[self notifyUpdate];
[self _save];
[self notifyUpdate];
}];
}

Expand Down
Loading

0 comments on commit ecf3582

Please sign in to comment.