Skip to content

Commit

Permalink
Merge pull request #377 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release 7.0.2
  • Loading branch information
akashvercetti authored Oct 10, 2024
2 parents 7c6ec5f + 73dbdca commit cc75737
Show file tree
Hide file tree
Showing 36 changed files with 1,202 additions and 86 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

### [Version 7.0.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/7.0.2) (October 10, 2024)

#### Added
- Adds support for custom handshake domains.
- Adds support for custom code in-app templates definitions through a json scheme.

### [Version 7.0.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/7.0.1) (August 22, 2024)

#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CleverTap-iOS-SDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ s.ios.resource_bundle = {'CleverTapSDK' => ['CleverTapSDK/**/*.{png,xib,ht
s.ios.deployment_target = '9.0'
s.ios.source_files = 'CleverTapSDK/**/*.{h,m}'
s.ios.exclude_files = 'CleverTapSDK/include/**/*.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+DisplayUnit.h', 'CleverTapSDK/CleverTap+FeatureFlags.h', 'CleverTapSDK/CleverTap+ProductConfig.h', 'CleverTapSDK/CleverTapPushNotificationDelegate.h', 'CleverTapSDK/CleverTapURLDelegate.h', 'CleverTapSDK/CleverTap+InAppNotifications.h', 'CleverTapSDK/CleverTap+SCDomain.h', 'CleverTapSDK/CleverTap+PushPermission.h', 'CleverTapSDK/InApps/CTLocalInApp.h', 'CleverTapSDK/CleverTap+CTVar.h', 'CleverTapSDK/ProductExperiences/CTVar.h', 'CleverTapSDK/LeanplumCT.h', 'CleverTapSDK/InApps/CustomTemplates/CTInAppTemplateBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTAppFunctionBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplatePresenter.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplateProducer.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplateBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplate.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplatesManager.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+DisplayUnit.h', 'CleverTapSDK/CleverTap+FeatureFlags.h', 'CleverTapSDK/CleverTap+ProductConfig.h', 'CleverTapSDK/CleverTapPushNotificationDelegate.h', 'CleverTapSDK/CleverTapURLDelegate.h', 'CleverTapSDK/CleverTap+InAppNotifications.h', 'CleverTapSDK/CleverTap+SCDomain.h', 'CleverTapSDK/CleverTap+PushPermission.h', 'CleverTapSDK/InApps/CTLocalInApp.h', 'CleverTapSDK/CleverTap+CTVar.h', 'CleverTapSDK/ProductExperiences/CTVar.h', 'CleverTapSDK/LeanplumCT.h', 'CleverTapSDK/InApps/CustomTemplates/CTInAppTemplateBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTAppFunctionBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplatePresenter.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplateProducer.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplateBuilder.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplate.h', 'CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.h', 'CleverTapSDK/InApps/CustomTemplates/CTCustomTemplatesManager.h', 'CleverTapSDK/InApps/CustomTemplates/CTJsonTemplateProducer.h'
s.tvos.deployment_target = '9.0'
s.tvos.source_files = 'CleverTapSDK/*.{h,m}', 'CleverTapSDK/FileDownload/*.{h,m}', 'CleverTapSDK/ProductConfig/**/*.{h,m}', 'CleverTapSDK/FeatureFlags/**/*.{h,m}', 'CleverTapSDK/ProductExperiences/*.{h,m}', 'CleverTapSDK/Swizzling/*.{h,m}', 'CleverTapSDK/Session/*.{h,m}'
s.tvos.exclude_files = 'CleverTapSDK/include/**/*.h', 'CleverTapSDK/CleverTapJSInterface.{h,m}', 'CleverTapSDK/CTInAppNotification.{h,m}', 'CleverTapSDK/CTNotificationButton.{h,m}', 'CleverTapSDK/CTNotificationAction.{h,m}', 'CleverTapSDK/CTPushPrimerManager.{h,m}', 'CleverTapSDK/InApps/*.{h,m}', 'CleverTapSDK/InApps/**/*.{h,m}', 'CleverTapSDK/CTInAppFCManager.{h,m}', 'CleverTapSDK/CTInAppDisplayViewController.{h,m}'
Expand Down
18 changes: 18 additions & 0 deletions CleverTapSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
4E872969277CDF9000A7A618 /* inapp_alert.json in Resources */ = {isa = PBXBuildFile; fileRef = 4E1F1561277090D6009387AE /* inapp_alert.json */; };
4E87296E277CE8EB00A7A618 /* StubHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E87296D277CE8EB00A7A618 /* StubHelper.m */; };
4E872973277CEE6700A7A618 /* TestConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E872972277CEE6700A7A618 /* TestConstants.m */; };
4E87397B2C92223C00FDFDFD /* CTDomainFactoryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8739772C921D9000FDFDFD /* CTDomainFactoryTests.m */; };
4E8B81662AD2ADAE00714BB4 /* CTSwizzleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8B81642AD2ADAE00714BB4 /* CTSwizzleManager.m */; };
4E8B81672AD2ADAE00714BB4 /* CTSwizzleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8B81642AD2ADAE00714BB4 /* CTSwizzleManager.m */; };
4E8B81682AD2ADAE00714BB4 /* CTSwizzleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E8B81652AD2ADAE00714BB4 /* CTSwizzleManager.h */; };
Expand Down Expand Up @@ -337,6 +338,9 @@
6AA1357C2A2E467800EFF2C1 /* NSDictionary+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA135782A2E467800EFF2C1 /* NSDictionary+Extensions.m */; };
6B0063BB2B18EC9E0063BF79 /* image_interstitial.html in Resources */ = {isa = PBXBuildFile; fileRef = 6B0063BA2B18EC9E0063BF79 /* image_interstitial.html */; };
6B0063BC2B18EC9E0063BF79 /* image_interstitial.html in Resources */ = {isa = PBXBuildFile; fileRef = 6B0063BA2B18EC9E0063BF79 /* image_interstitial.html */; };
6B12F7662C94312D0045D743 /* CTJsonTemplateProducer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B12F7652C94312D0045D743 /* CTJsonTemplateProducer.m */; };
6B12F7672C94312D0045D743 /* CTJsonTemplateProducer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B12F7642C94312D0045D743 /* CTJsonTemplateProducer.h */; settings = {ATTRIBUTES = (Public, ); }; };
6B12F7692C9466460045D743 /* CTJsonTemplateProducerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B12F7682C9466460045D743 /* CTJsonTemplateProducerTest.m */; };
6B32A09E2B9901AA009ADC57 /* CTCustomTemplateBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B32A09C2B9901AA009ADC57 /* CTCustomTemplateBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; };
6B32A09F2B9901AA009ADC57 /* CTCustomTemplateBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B32A09D2B9901AA009ADC57 /* CTCustomTemplateBuilder.m */; };
6B32A0A12B99033F009ADC57 /* CTCustomTemplateBuilder-Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B32A0A02B99033F009ADC57 /* CTCustomTemplateBuilder-Internal.h */; };
Expand Down Expand Up @@ -819,6 +823,8 @@
4E87296D277CE8EB00A7A618 /* StubHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StubHelper.m; sourceTree = "<group>"; };
4E872971277CEE6700A7A618 /* TestConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestConstants.h; sourceTree = "<group>"; };
4E872972277CEE6700A7A618 /* TestConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestConstants.m; sourceTree = "<group>"; };
4E8739772C921D9000FDFDFD /* CTDomainFactoryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTDomainFactoryTests.m; sourceTree = "<group>"; };
4E87397C2C9223B300FDFDFD /* CTDomainFactory+Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CTDomainFactory+Tests.h"; sourceTree = "<group>"; };
4E8B81642AD2ADAE00714BB4 /* CTSwizzleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTSwizzleManager.m; sourceTree = "<group>"; };
4E8B81652AD2ADAE00714BB4 /* CTSwizzleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTSwizzleManager.h; sourceTree = "<group>"; };
4E8B816A2AD2B2FD00714BB4 /* CleverTapInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CleverTapInternal.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -891,6 +897,9 @@
6AF6C7FF2A1BDA6A001E38A8 /* LeanplumCT.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LeanplumCT.h; sourceTree = "<group>"; };
6AF6C8002A1BDA6A001E38A8 /* LeanplumCT.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LeanplumCT.m; sourceTree = "<group>"; };
6B0063BA2B18EC9E0063BF79 /* image_interstitial.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = image_interstitial.html; sourceTree = "<group>"; };
6B12F7642C94312D0045D743 /* CTJsonTemplateProducer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTJsonTemplateProducer.h; sourceTree = "<group>"; };
6B12F7652C94312D0045D743 /* CTJsonTemplateProducer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTJsonTemplateProducer.m; sourceTree = "<group>"; };
6B12F7682C9466460045D743 /* CTJsonTemplateProducerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTJsonTemplateProducerTest.m; sourceTree = "<group>"; };
6B32A09C2B9901AA009ADC57 /* CTCustomTemplateBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTCustomTemplateBuilder.h; sourceTree = "<group>"; };
6B32A09D2B9901AA009ADC57 /* CTCustomTemplateBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTCustomTemplateBuilder.m; sourceTree = "<group>"; };
6B32A0A02B99033F009ADC57 /* CTCustomTemplateBuilder-Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CTCustomTemplateBuilder-Internal.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1500,6 +1509,7 @@
6B9157B82C10F40C00B1C907 /* CTInAppNotificationDisplayDelegateMock.m */,
6BAFFE9A2C371B4500654CAF /* CTFileDownloaderCustomTemplatesMock.h */,
6BAFFE9B2C371B4500654CAF /* CTFileDownloaderCustomTemplatesMock.m */,
6B12F7682C9466460045D743 /* CTJsonTemplateProducerTest.m */,
);
path = CustomTemplates;
sourceTree = "<group>";
Expand Down Expand Up @@ -1560,6 +1570,8 @@
6BB778C62BECEC2700A41628 /* CTCustomTemplateInAppData.m */,
6BB778D82BFD277400A41628 /* CTCustomTemplatesManager-Internal.h */,
6B9157BA2C11D07200B1C907 /* CTCustomTemplateInAppData-Internal.h */,
6B12F7642C94312D0045D743 /* CTJsonTemplateProducer.h */,
6B12F7652C94312D0045D743 /* CTJsonTemplateProducer.m */,
);
path = CustomTemplates;
sourceTree = "<group>";
Expand Down Expand Up @@ -1600,6 +1612,8 @@
6BD851C82B45CD1800FA5298 /* CTMultiDelegateManager+Tests.h */,
0B5564552C25946C00B87284 /* CTUserInfoMigratorTest.m */,
0B995A492C36AEDC00AF6006 /* CTLocalDataStoreTests.m */,
4E8739772C921D9000FDFDFD /* CTDomainFactoryTests.m */,
4E87397C2C9223B300FDFDFD /* CTDomainFactory+Tests.h */,
);
path = CleverTapSDKTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1973,6 +1987,7 @@
6A4427B92AA3903C0098866F /* CTTriggerCondition.h in Headers */,
4E49AE53275D24570074A774 /* CTValidationResultStack.h in Headers */,
07B94544219EA34300D4C542 /* CTInboxController.h in Headers */,
6B12F7672C94312D0045D743 /* CTJsonTemplateProducer.h in Headers */,
4E838C40299F419900ED0875 /* ContentMerger.h in Headers */,
5709005327FD8E1F0011B89F /* CleverTap+SCDomain.h in Headers */,
6BB727152B8E463C009CE7D0 /* CTCustomTemplate.h in Headers */,
Expand Down Expand Up @@ -2522,6 +2537,7 @@
32394C2129FA264B00956058 /* CTPreferencesTest.m in Sources */,
6BD334F02AF545C80099E33E /* CTInAppStoreTest.m in Sources */,
32394C1F29FA251E00956058 /* CTEventBuilderTest.m in Sources */,
6B12F7692C9466460045D743 /* CTJsonTemplateProducerTest.m in Sources */,
6BB778D02BEE4C3400A41628 /* CTNotificationActionTest.m in Sources */,
D02AC2EB2767F4590031C1BE /* BaseTestCase.m in Sources */,
6BAFFE9C2C371B4500654CAF /* CTFileDownloaderCustomTemplatesMock.m in Sources */,
Expand All @@ -2539,6 +2555,7 @@
0B995A4A2C36AEDC00AF6006 /* CTLocalDataStoreTests.m in Sources */,
6A4427C52AA6515A0098866F /* CTTriggersMatcherTest.m in Sources */,
6B32A0B02B9DC374009ADC57 /* CTTemplateArgumentTest.m in Sources */,
4E87397B2C92223C00FDFDFD /* CTDomainFactoryTests.m in Sources */,
0B5564562C25946C00B87284 /* CTUserInfoMigratorTest.m in Sources */,
4E2CF1442AC56D8F00441E8B /* CTEncryptionTests.m in Sources */,
32394C2729FA278C00956058 /* CTUriHelperTest.m in Sources */,
Expand Down Expand Up @@ -2590,6 +2607,7 @@
D01651AF2097B38400660178 /* CTEventBuilder.m in Sources */,
D020C929209006AD0073F61E /* CTUriHelper.m in Sources */,
07B9454C219EA34300D4C542 /* CTMessageMO.m in Sources */,
6B12F7662C94312D0045D743 /* CTJsonTemplateProducer.m in Sources */,
48F9FD1E2C3D30BF00617770 /* CTFileDownloader.m in Sources */,
D0D4C9F32414EE6C0029477E /* CleverTapFeatureFlags.m in Sources */,
4E5A02DE2A4C5FD800DE242A /* LeanplumCT.m in Sources */,
Expand Down
13 changes: 11 additions & 2 deletions CleverTapSDK/CTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
extern NSString *const kCTApiDomain;
extern NSString *const kCTNotifViewedApiDomain;
extern NSString *const kHANDSHAKE_URL;
extern NSString *const kHANDSHAKE_DOMAIN_HEADER;
extern NSString *const ACCOUNT_ID_HEADER;
extern NSString *const ACCOUNT_TOKEN_HEADER;

extern NSString *const REDIRECT_DOMAIN_KEY;
extern NSString *const REDIRECT_NOTIF_VIEWED_DOMAIN_KEY;

extern NSString *const kLastSessionPing;
extern NSString *const kLastSessionTime;
extern NSString *const kSessionId;

#define CleverTapLogInfo(level, fmt, ...) if(level >= 0) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogDebug(level, fmt, ...) if(level > 0) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogInternal(level, fmt, ...) if (level > 1) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogInternal(level, fmt, ...) if (level >= 1) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogStaticInfo(fmt, ...) if([CTLogger getDebugLevel] >= 0) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogStaticDebug(fmt, ...) if([CTLogger getDebugLevel] > 0) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogStaticInternal(fmt, ...) if([CTLogger getDebugLevel] > 1) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }
#define CleverTapLogStaticInternal(fmt, ...) if([CTLogger getDebugLevel] >= 1) { NSLog((@"%@" fmt), @"[CleverTap]: ", ##__VA_ARGS__); }

#define CT_TRY @try {
#define CT_END_TRY }\
@catch (NSException *e) {\
[CTLogger logInternalError:e]; }

#define CLTAP_CUSTOM_TEMPLATE_EXCEPTION @"CleverTapCustomTemplateException"

#pragma mark Constants for General data
#define CLTAP_REQUEST_TIME_OUT_INTERVAL 10
#define CLTAP_ACCOUNT_ID_LABEL @"CleverTapAccountID"
Expand All @@ -31,6 +39,7 @@ extern NSString *const kSessionId;
#define CLTAP_USE_CUSTOM_CLEVERTAP_ID_LABEL @"CleverTapUseCustomId"
#define CLTAP_DISABLE_IDFV_LABEL @"CleverTapDisableIDFV"
#define CLTAP_ENABLE_FILE_PROTECTION @"CleverTapEnableFileProtection"
#define CLTAP_HANDSHAKE_DOMAIN @"CleverTapHandshakeDomain"
#define CLTAP_BETA_LABEL @"CleverTapBeta"
#define CLTAP_SESSION_LENGTH_MINS 20
#define CLTAP_SESSION_LAST_VC_TRAIL @"last_session_vc_trail"
Expand Down
6 changes: 6 additions & 0 deletions CleverTapSDK/CTConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
NSString *const kCTApiDomain = @"clevertap-prod.com";
NSString *const kCTNotifViewedApiDomain = @"spiky.clevertap-prod.com";
NSString *const kHANDSHAKE_URL = @"https://clevertap-prod.com/hello";
NSString *const kHANDSHAKE_DOMAIN_HEADER =@"X-CleverTap-Handshake-Domain";
NSString *const ACCOUNT_ID_HEADER = @"X-CleverTap-Account-Id";
NSString *const ACCOUNT_TOKEN_HEADER = @"X-CleverTap-Token";

NSString *const REDIRECT_DOMAIN_KEY = @"CLTAP_REDIRECT_DOMAIN_KEY";
NSString *const REDIRECT_NOTIF_VIEWED_DOMAIN_KEY = @"CLTAP_REDIRECT_NOTIF_VIEWED_DOMAIN_KEY";

NSString *const kLastSessionPing = @"last_session_ping";
NSString *const kLastSessionTime = @"lastSessionTime";
Expand Down
5 changes: 1 addition & 4 deletions CleverTapSDK/CTDomainFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#import "CTConstants.h"
#import "CleverTapInstanceConfigPrivate.h"


NSString *const REDIRECT_DOMAIN_KEY = @"CLTAP_REDIRECT_DOMAIN_KEY";
NSString *const REDIRECT_NOTIF_VIEWED_DOMAIN_KEY = @"CLTAP_REDIRECT_NOTIF_VIEWED_DOMAIN_KEY";

@interface CTDomainFactory ()
@property (nonatomic, strong) CleverTapInstanceConfig *config;

Expand Down Expand Up @@ -75,6 +71,7 @@ - (NSString *)loadRedirectDomain {
return self.explictEndpointDomain;
}
}

NSString *domain = nil;
if (self.config.isDefaultInstance) {
domain = [CTPreferences getStringForKey:[CTPreferences storageKeyWithSuffix:REDIRECT_DOMAIN_KEY config: self.config] withResetValue:[CTPreferences getStringForKey:REDIRECT_DOMAIN_KEY withResetValue:nil]];
Expand Down
1 change: 1 addition & 0 deletions CleverTapSDK/CTPlistInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@property (nonatomic, assign, readonly) BOOL beta;
@property (nonatomic, assign, readonly) BOOL disableIDFV;
@property (nonatomic, assign) BOOL enableFileProtection;
@property (nonatomic, strong, readonly, nullable) NSString *handshakeDomain;
@property (nonatomic, readonly) CleverTapEncryptionLevel encryptionLevel;

+ (instancetype _Nullable)sharedInstance;
Expand Down
2 changes: 2 additions & 0 deletions CleverTapSDK/CTPlistInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ - (instancetype)init {
NSString *enableFileProtection = [CTPlistInfo getMetaDataForAttribute:CLTAP_ENABLE_FILE_PROTECTION];
_enableFileProtection = (enableFileProtection && [enableFileProtection isEqualToString:@"1"]);

_handshakeDomain = [CTPlistInfo getMetaDataForAttribute:CLTAP_HANDSHAKE_DOMAIN];

NSString *encryptionLevel = [CTPlistInfo getMetaDataForAttribute:CLTAP_ENCRYPTION_LEVEL];
[self setEncryption:encryptionLevel];
}
Expand Down
3 changes: 0 additions & 3 deletions CleverTapSDK/CTRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#import "CTConstants.h"
#import "CTUtils.h"

NSString *const ACCOUNT_ID_HEADER = @"X-CleverTap-Account-Id";
NSString *const ACCOUNT_TOKEN_HEADER = @"X-CleverTap-Token";

@interface CTRequest()

@property (nonatomic, strong, nullable) id params;
Expand Down
10 changes: 9 additions & 1 deletion CleverTapSDK/CTRequestFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
@implementation CTRequestFactory

+ (CTRequest *_Nonnull)helloRequestWithConfig:(CleverTapInstanceConfig *_Nonnull)config {
return [[CTRequest alloc] initWithHttpMethod:@"GET" config:config params:nil url:kHANDSHAKE_URL];
NSString *helloUrl = kHANDSHAKE_URL;
if (config.handshakeDomain) {
helloUrl = [NSString stringWithFormat:@"https://%@/hello",config.handshakeDomain];
}
CTRequest *request = [[CTRequest alloc] initWithHttpMethod:@"GET" config:config params:nil url:helloUrl];
if (config.handshakeDomain) {
[request.urlRequest setValue:config.handshakeDomain forHTTPHeaderField:kHANDSHAKE_DOMAIN_HEADER];
}
return request;
}

+ (CTRequest *_Nonnull)eventRequestWithConfig:(CleverTapInstanceConfig *_Nonnull)config params:(id _Nullable)params url:(NSString *_Nonnull)url {
Expand Down
Loading

0 comments on commit cc75737

Please sign in to comment.