Skip to content

Commit

Permalink
Merge pull request #38 from CleverTap/3.7.2
Browse files Browse the repository at this point in the history
3.7.2
  • Loading branch information
Aditi3 authored Dec 11, 2019
2 parents f1e511f + 5a014a2 commit 40c0de4
Show file tree
Hide file tree
Showing 63 changed files with 4,603 additions and 3,844 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGE LOG

## Version 3.7.2 (December 11, 2019)
* Adds support for Native Display
* Bug fixes and performance improvements

## Version 3.7.1 (October 17, 2019)
* Bug fixes and performance improvements

Expand Down
4 changes: 2 additions & 2 deletions 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.7.1"
s.version = "3.7.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 All @@ -13,7 +13,7 @@ s.ios.dependency 'SDWebImage', '~> 5.1'
s.ios.resources = 'CleverTapSDK/**/*.{png,xib}', 'CleverTapSDK/**/*.xcdatamodeld'
s.ios.deployment_target = '8.0'
s.ios.source_files = 'CleverTapSDK/**/*.{h,m}'
s.ios.public_header_files = 'CleverTapSDK/CleverTap.h', 'CleverTapSDK/CleverTap+SSLPinning.h','CleverTapSDK/CleverTap+Inbox.h', 'CleverTapSDK/CleverTapInstanceConfig.h', 'CleverTapSDK/CleverTapBuildInfo.h', 'CleverTapSDK/CleverTapEventDetail.h', 'CleverTapSDK/CleverTapInAppNotificationDelegate.h', 'CleverTapSDK/CleverTapSyncDelegate.h', 'CleverTapSDK/CleverTapTrackedViewController.h', 'CleverTapSDK/CleverTapUTMDetail.h', 'CleverTapSDK/CleverTapJSInterface.h', 'CleverTapSDK/CleverTap+ABTesting.h'
s.ios.public_header_files = 'CleverTapSDK/CleverTap.h', 'CleverTapSDK/CleverTap+SSLPinning.h','CleverTapSDK/CleverTap+Inbox.h', 'CleverTapSDK/CleverTapInstanceConfig.h', 'CleverTapSDK/CleverTapBuildInfo.h', 'CleverTapSDK/CleverTapEventDetail.h', 'CleverTapSDK/CleverTapInAppNotificationDelegate.h', 'CleverTapSDK/CleverTapSyncDelegate.h', 'CleverTapSDK/CleverTapTrackedViewController.h', 'CleverTapSDK/CleverTapUTMDetail.h', 'CleverTapSDK/CleverTapJSInterface.h', 'CleverTapSDK/CleverTap+ABTesting.h', 'CleverTapSDK/CleverTap+DisplayUnit.h'
s.tvos.deployment_target = '9.0'
s.tvos.source_files = 'CleverTapSDK/*.{h,m}'
s.tvos.exclude_files = 'CleverTapSDK/CleverTapJSInterface.{h,m}'
Expand Down
44 changes: 44 additions & 0 deletions CleverTapSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
0701E95C2372BA250034AAC2 /* CleverTap+DisplayUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0701E95A2372BA250034AAC2 /* CleverTap+DisplayUnit.h */; settings = {ATTRIBUTES = (Public, ); }; };
0701E9622372C1950034AAC2 /* CTDisplayUnitController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0701E9602372C1950034AAC2 /* CTDisplayUnitController.h */; };
0701E9632372C1950034AAC2 /* CTDisplayUnitController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0701E9612372C1950034AAC2 /* CTDisplayUnitController.m */; };
0701E9652372DE9C0034AAC2 /* CleverTapDisplayUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = 0701E9642372DE9C0034AAC2 /* CleverTapDisplayUnit.m */; };
0701E975237A9A760034AAC2 /* CleverTapDisplayUnitContent.m in Sources */ = {isa = PBXBuildFile; fileRef = 0701E973237A9A760034AAC2 /* CleverTapDisplayUnitContent.m */; };
070229A8220831CB0093CA41 /* ct_default_landscape_image.png in Resources */ = {isa = PBXBuildFile; fileRef = 070229A6220831CB0093CA41 /* ct_default_landscape_image.png */; };
070229A9220831CB0093CA41 /* ct_default_video.png in Resources */ = {isa = PBXBuildFile; fileRef = 070229A7220831CB0093CA41 /* ct_default_video.png */; };
070229AD22084B0B0093CA41 /* ct_default_portrait_image.png in Resources */ = {isa = PBXBuildFile; fileRef = 070229AC22084B0B0093CA41 /* ct_default_portrait_image.png */; };
Expand Down Expand Up @@ -349,6 +354,11 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0701E95A2372BA250034AAC2 /* CleverTap+DisplayUnit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CleverTap+DisplayUnit.h"; sourceTree = "<group>"; };
0701E9602372C1950034AAC2 /* CTDisplayUnitController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTDisplayUnitController.h; sourceTree = "<group>"; };
0701E9612372C1950034AAC2 /* CTDisplayUnitController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTDisplayUnitController.m; sourceTree = "<group>"; };
0701E9642372DE9C0034AAC2 /* CleverTapDisplayUnit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CleverTapDisplayUnit.m; sourceTree = "<group>"; };
0701E973237A9A760034AAC2 /* CleverTapDisplayUnitContent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CleverTapDisplayUnitContent.m; sourceTree = "<group>"; };
070229A6220831CB0093CA41 /* ct_default_landscape_image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ct_default_landscape_image.png; sourceTree = "<group>"; };
070229A7220831CB0093CA41 /* ct_default_video.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ct_default_video.png; sourceTree = "<group>"; };
070229AC22084B0B0093CA41 /* ct_default_portrait_image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ct_default_portrait_image.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -650,6 +660,33 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0701E9572372AD550034AAC2 /* DisplayUnit */ = {
isa = PBXGroup;
children = (
0701E95F2372C0970034AAC2 /* models */,
0701E95E2372BC550034AAC2 /* controllers */,
);
path = DisplayUnit;
sourceTree = "<group>";
};
0701E95E2372BC550034AAC2 /* controllers */ = {
isa = PBXGroup;
children = (
0701E9602372C1950034AAC2 /* CTDisplayUnitController.h */,
0701E9612372C1950034AAC2 /* CTDisplayUnitController.m */,
);
path = controllers;
sourceTree = "<group>";
};
0701E95F2372C0970034AAC2 /* models */ = {
isa = PBXGroup;
children = (
0701E9642372DE9C0034AAC2 /* CleverTapDisplayUnit.m */,
0701E973237A9A760034AAC2 /* CleverTapDisplayUnitContent.m */,
);
path = models;
sourceTree = "<group>";
};
071EB476217F6427008F0FAB /* InApps */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1027,6 +1064,7 @@
D0C7BBBF207D82C0001345EF /* CleverTapSDK */ = {
isa = PBXGroup;
children = (
0701E9572372AD550034AAC2 /* DisplayUnit */,
07B874E122E982F400328982 /* ABTesting */,
07B94520219EA33800D4C542 /* Inbox */,
071EB476217F6427008F0FAB /* InApps */,
Expand All @@ -1035,6 +1073,7 @@
D0CACF8A20B890EA00A02327 /* CleverTap+SSLPinning.h */,
07B9454F219EA38F00D4C542 /* CleverTap+Inbox.h */,
07B8757C22E983A200328982 /* CleverTap+ABTesting.h */,
0701E95A2372BA250034AAC2 /* CleverTap+DisplayUnit.h */,
D01DBF25207FCEFB00E8F1B0 /* CleverTapInstanceConfigPrivate.h */,
D01A0892207EC2D400423D6F /* CleverTapInstanceConfig.h */,
D01A0893207EC2D400423D6F /* CleverTapInstanceConfig.m */,
Expand Down Expand Up @@ -1190,6 +1229,7 @@
07B8753322E982F400328982 /* CTWebSocket.h in Headers */,
07D8C08B21DDEC54006F5A1B /* CTCarouselImageView.h in Headers */,
071EB515217F6427008F0FAB /* CTInterstitialViewController.h in Headers */,
0701E9622372C1950034AAC2 /* CTDisplayUnitController.h in Headers */,
0797132F21A2F09A0011C9A3 /* CTSwipeView.h in Headers */,
07B8757022E982F400328982 /* NSInvocation+CTHelper.h in Headers */,
071EB4F8217F6427008F0FAB /* CTInterstitialImageViewController.h in Headers */,
Expand Down Expand Up @@ -1219,6 +1259,7 @@
D0596EFA208A6A9000A80753 /* CTSwizzle.h in Headers */,
071EB508217F6427008F0FAB /* CTBaseHeaderFooterViewController.h in Headers */,
D0A84AD8209135D400191B1F /* CTPreferences.h in Headers */,
0701E95C2372BA250034AAC2 /* CleverTap+DisplayUnit.h in Headers */,
071EB4FB217F6427008F0FAB /* CTInAppDisplayViewController.h in Headers */,
07B8753922E982F400328982 /* CTABTestEditorDeviceInfoMessageResponse.h in Headers */,
D0A6626D20801E7F00B403F3 /* CTDeviceInfo.h in Headers */,
Expand Down Expand Up @@ -1476,6 +1517,7 @@
071EB4CD217F6427008F0FAB /* CTInAppUtils.m in Sources */,
D0CACF9120B8A44C00A02327 /* CTCertificatePinning.m in Sources */,
D033FB84208FE51200B4390F /* CTUtils.m in Sources */,
0701E975237A9A760034AAC2 /* CleverTapDisplayUnitContent.m in Sources */,
07B8757B22E982F400328982 /* CTABTestController.m in Sources */,
D0405B4722050C5200D64EC3 /* CTInboxUtils.m in Sources */,
071EB50B217F6427008F0FAB /* CTAVPlayerControlsViewController.m in Sources */,
Expand All @@ -1493,6 +1535,7 @@
07B8756E22E982F400328982 /* CTEditorSession.m in Sources */,
07B8756522E982F400328982 /* CTNSDictionaryFromNSAttributedStringValueTransformer.m in Sources */,
07B8756322E982F400328982 /* CTNSDictionaryFromCGSizeValueTransformer.m in Sources */,
0701E9632372C1950034AAC2 /* CTDisplayUnitController.m in Sources */,
07B8754222E982F400328982 /* CTABTestEditorVarsMessageRequest.m in Sources */,
D0213D4E207D905800FE5740 /* CleverTapTrackedViewController.m in Sources */,
07B8756722E982F400328982 /* CTCGFloatFromNSNumberValueTransformer.m in Sources */,
Expand Down Expand Up @@ -1550,6 +1593,7 @@
07B8755822E982F400328982 /* CTPropertyDescription.m in Sources */,
071EB4C8217F6427008F0FAB /* CTDismissButton.m in Sources */,
07B8756822E982F400328982 /* CTNSDictionaryFromCATransform3DValueTransformer.m in Sources */,
0701E9652372DE9C0034AAC2 /* CleverTapDisplayUnit.m in Sources */,
072F9E3E21B1368000BC6313 /* CTInboxIconMessageCell.m in Sources */,
071EB4D8217F6427008F0FAB /* CTHalfInterstitialImageViewController.m in Sources */,
07B8757122E982F400328982 /* CTEditorImageCache.m in Sources */,
Expand Down
8 changes: 4 additions & 4 deletions CleverTapSDK/ABTesting/controllers/CTABTestController.m
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ - (void)handleSessionEnded {
[[CTInAppResources getSharedApplication] setIdleTimerDisabled:NO];
});
self.sessionEnded = YES;
CTABVariant *variant = [_session sessionObjectForKey:kSessionVariantKey];
CTABVariant *variant = [_session sessionObjectForKey:kCTSessionVariantKey];
if (variant) {
[variant revertActions];
[variant cleanup];
Expand Down Expand Up @@ -493,10 +493,10 @@ - (CTABTestEditorMessage *)editorMessageForMessage:(NSDictionary*)messageDiction
}

- (void)handleTestEditorChangeRequestWithData:(NSDictionary *)data {
CTABVariant *variant = [_session sessionObjectForKey:kSessionVariantKey];
CTABVariant *variant = [_session sessionObjectForKey:kCTSessionVariantKey];
if (!variant) {
variant = [[CTABVariant alloc] init];
[_session setSessionObject:variant forKey:kSessionVariantKey];
[_session setSessionObject:variant forKey:kCTSessionVariantKey];
}
id actions = data[@"actions"];
if ([actions isKindOfClass:[NSArray class]]) {
Expand All @@ -505,7 +505,7 @@ - (void)handleTestEditorChangeRequestWithData:(NSDictionary *)data {
}

- (void)handleTestEditorClearRequestWithData:(NSDictionary *)data {
CTABVariant *variant = [_session sessionObjectForKey:kSessionVariantKey];
CTABVariant *variant = [_session sessionObjectForKey:kCTSessionVariantKey];
if (variant) {
NSArray *actions = data[@"actions"];
if (actions && actions.count == 0) {
Expand Down
8 changes: 4 additions & 4 deletions CleverTapSDK/ABTesting/uieditor/websocket/CTWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ - (NSString *)CT_origin;
@end


@interface _MPRunLoopThread : NSThread
@interface _CTRunLoopThread : NSThread

@property (nonatomic, readonly) NSRunLoop *runLoop;

Expand Down Expand Up @@ -1634,15 +1634,15 @@ static inline int32_t validate_dispatch_data_partial_string(NSData *data) {

#endif

static _MPRunLoopThread *networkThread = nil;
static _CTRunLoopThread *networkThread = nil;
static NSRunLoop *networkRunLoop = nil;

@implementation NSRunLoop (CTWebSocket)

+ (NSRunLoop *)CT_networkRunLoop {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
networkThread = [[_MPRunLoopThread alloc] init];
networkThread = [[_CTRunLoopThread alloc] init];
networkThread.name = @"com.clevertap.WebSocket.NetworkThread";
[networkThread start];
networkRunLoop = networkThread.runLoop;
Expand All @@ -1654,7 +1654,7 @@ + (NSRunLoop *)CT_networkRunLoop {
@end


@implementation _MPRunLoopThread {
@implementation _CTRunLoopThread {
dispatch_group_t _waitGroup;
}

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

#import <Foundation/Foundation.h>

extern NSString * _Nullable const kSessionVariantKey;
extern NSString * _Nullable const kCTSessionVariantKey;
extern NSString * _Nullable const kSnapshotSerializerConfigKey;

extern NSString * _Nullable const CTABTestEditorChangeMessageRequestType;
Expand Down
2 changes: 1 addition & 1 deletion CleverTapSDK/ABTesting/utils/CTABTestUtils.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "CTABTestUtils.h"

NSString * const kSessionVariantKey = @"session_variant";
NSString * const kCTSessionVariantKey = @"session_variant";
NSString * const kSnapshotSerializerConfigKey = @"snapshot_class_descriptions";

NSString * const CTABTestEditorSessionStartRequestType = @"matched";
Expand Down
1 change: 1 addition & 0 deletions CleverTapSDK/CTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extern NSString *const kCTNotifViewedApiDomain;
#define CLTAP_INAPP_NOTIF_SHOW_CLOSE @"sc"
#define CLTAP_INAPP_JSON_RESPONSE_KEY @"inapp_notifs"
#define CLTAP_INBOX_MSG_JSON_RESPONSE_KEY @"inbox_notifs"
#define CLTAP_DISPLAY_UNIT_JSON_RESPONSE_KEY @"adUnit_notifs"
#define CLTAP_PREFS_INAPP_KEY @"inapp_notifs"
#define CLTAP_AB_EXP_JSON_RESPONSE_KEY @"ab_exps"
#define CLTAP_INAPP_CLOSE_IV_WIDTH 40
Expand Down
6 changes: 6 additions & 0 deletions CleverTapSDK/CTEventBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@class CTValidationResult;
@class CTInAppNotification;
@class CleverTapInboxMessage;
@class CleverTapDisplayUnit;

@interface CTEventBuilder : NSObject

Expand All @@ -27,4 +28,9 @@
andQueryParameters:(NSDictionary * _Nullable)params
completionHandler:(void(^ _Nonnull)(NSDictionary * _Nullable event, NSArray<CTValidationResult*> * _Nullable errors))completion;

+ (void)buildDisplayViewStateEvent:(BOOL)clicked
forDisplayUnit:(CleverTapDisplayUnit * _Nonnull)displayUnit
andQueryParameters:(NSDictionary * _Nullable)params
completionHandler:(void(^ _Nonnull)(NSDictionary * _Nullable event, NSArray<CTValidationResult*> * _Nullable errors))completion;

@end
25 changes: 25 additions & 0 deletions CleverTapSDK/CTEventBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#import "CTUtils.h"
#import "CTInAppNotification.h"
#import "CleverTap+Inbox.h"
#import "CleverTap+DisplayUnit.h"

NSString *const kCHARGED_EVENT = @"Charged";

Expand Down Expand Up @@ -357,4 +358,28 @@ + (void)buildInboxMessageStateEvent:(BOOL)clicked
completion(nil, nil);
}
}

+ (void)buildDisplayViewStateEvent:(BOOL)clicked
forDisplayUnit:(CleverTapDisplayUnit *)displayUnit
andQueryParameters:(NSDictionary *)params
completionHandler:(void(^)(NSDictionary* event, NSArray<CTValidationResult*> *errors))completion {
@try {
NSMutableDictionary *event = [NSMutableDictionary new];
NSMutableDictionary *notif = [NSMutableDictionary new];
NSDictionary *data = displayUnit.json;
for (NSString *x in [data allKeys]) {
if (!([CTUtils doesString:x startWith:CLTAP_NOTIFICATION_TAG] || [CTUtils doesString:x startWith:CLTAP_NOTIFICATION_TAG_SECONDARY]))
continue;
NSString *key = [x stringByReplacingOccurrencesOfString:CLTAP_NOTIFICATION_TAG withString:CLTAP_WZRK_PREFIX];
id value = data[x];
notif[key] = value;
}
notif[CLTAP_NOTIFICATION_CLICKED_TAG] = @((long) [[NSDate date] timeIntervalSince1970]);
event[@"evtName"] = clicked ? CLTAP_NOTIFICATION_CLICKED_EVENT_NAME : CLTAP_NOTIFICATION_VIEWED_EVENT_NAME;
event[@"evtData"] = notif;
completion(event, nil);
} @catch (NSException *e) {
completion(nil, nil);
}
}
@end
2 changes: 1 addition & 1 deletion CleverTapSDK/CleverTap+ABTesting.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import Foundation;
#import <Foundation/Foundation.h>
#import "CleverTap.h"

typedef void (^CleverTapExperimentsUpdatedBlock)(void);
Expand Down
Loading

0 comments on commit 40c0de4

Please sign in to comment.