-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from CleverTap/task/SDK-4043-handshake-domain
SDK - 4043 : Custom Handshake Domain
- Loading branch information
Showing
16 changed files
with
143 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#define WR_SDK_REVISION @"70001" | ||
#define WR_SDK_REVISION @"70002" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// CTDomainFactory+Tests.h | ||
// CleverTapSDKTests | ||
// | ||
// Created by Akash Malhotra on 12/09/24. | ||
// Copyright © 2024 CleverTap. All rights reserved. | ||
// | ||
|
||
#import "CleverTapInstanceConfig.h" | ||
#import "CTDomainFactory.h" | ||
|
||
@interface CTDomainFactory (Tests) | ||
- (NSString *)loadRedirectDomain; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// CTDomainFactoryTests.m | ||
// CleverTapSDKTests | ||
// | ||
// Created by Akash Malhotra on 12/09/24. | ||
// Copyright © 2024 CleverTap. All rights reserved. | ||
// | ||
#import <Foundation/Foundation.h> | ||
#import <XCTest/XCTest.h> | ||
#import "CleverTapInstanceConfig.h" | ||
#import "CTDomainFactory.h" | ||
#import "CTDomainFactory+Tests.h" | ||
#import "CTConstants.h" | ||
#import "CTPreferences.h" | ||
|
||
@interface CTDomainFactoryTests: XCTestCase | ||
@property (nonatomic, strong) NSString *region; | ||
@property (nonatomic, strong) CleverTapInstanceConfig *config; | ||
@property (nonatomic, strong) CTDomainFactory *domainFactory; | ||
@end | ||
|
||
@implementation CTDomainFactoryTests | ||
|
||
- (void)setUp { | ||
[super setUp]; | ||
self.region = @"testRegion"; | ||
self.config = [[CleverTapInstanceConfig alloc] initWithAccountId:@"testAccount" accountToken:@"testToken" accountRegion:self.region]; | ||
self.domainFactory = [[CTDomainFactory alloc]initWithConfig:self.config]; | ||
} | ||
|
||
- (void)tearDown { | ||
[self.domainFactory clearRedirectDomain]; | ||
self.domainFactory = nil; | ||
self.region = nil; | ||
[super tearDown]; | ||
} | ||
|
||
- (void)testLoadRedirectDomainRegion { | ||
NSString *domain = [self.domainFactory loadRedirectDomain]; | ||
NSString *result = [NSString stringWithFormat:@"%@.%@", self.region, kCTApiDomain].lowercaseString; | ||
XCTAssertEqualObjects(domain, result); | ||
} | ||
|
||
- (void)testLoadRedirectDomainCached { | ||
[self.domainFactory persistRedirectDomain]; | ||
NSString *domain = [CTPreferences getStringForKey:[CTPreferences storageKeyWithSuffix:REDIRECT_DOMAIN_KEY config: self.config] withResetValue:nil]; | ||
NSString *result = [self.domainFactory loadRedirectDomain]; | ||
XCTAssertEqualObjects(domain, result); | ||
} | ||
|
||
- (void)testLoadRedirectDomainCustomHandShake { | ||
CleverTapInstanceConfig *config = [[CleverTapInstanceConfig alloc] initWithAccountId:@"testAccount" accountToken:@"testToken"]; | ||
config.handshakeDomain = @"testCustomDomain"; | ||
CTDomainFactory *domainFactory = [[CTDomainFactory alloc]initWithConfig:config]; | ||
domainFactory.redirectDomain = config.handshakeDomain; | ||
[domainFactory persistRedirectDomain]; | ||
|
||
NSString *domain = [domainFactory loadRedirectDomain];; | ||
XCTAssertEqualObjects(domain, config.handshakeDomain); | ||
} | ||
|
||
- (void)testLoadRedirectDomainProxy { | ||
CleverTapInstanceConfig *config = [[CleverTapInstanceConfig alloc] initWithAccountId:@"testAccount" accountToken:@"testToken" proxyDomain:@"testProxydomain"]; | ||
CTDomainFactory *domainFactory = [[CTDomainFactory alloc]initWithConfig:config]; | ||
|
||
NSString *domain = [domainFactory loadRedirectDomain]; | ||
XCTAssertEqualObjects(domain, config.proxyDomain.lowercaseString); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.0.1 | ||
7.0.2 |