2222static NSString * const gdprUrlChina = @" https://gdpr.adjust.world" ;
2323static NSString * const subscritionUrlChina = @" https://subscription.adjust.world" ;
2424
25+ static NSString * const baseUrlEU = @" https://app.eu.adjust.com" ;
26+ static NSString * const gdprUrlEU = @" https://gdpr.eu.adjust.com" ;
27+ static NSString * const subscriptionUrlEU = @" https://subscription.eu.adjust.com" ;
28+
29+ static NSString * const baseUrlTR = @" https://app.tr.adjust.com" ;
30+ static NSString * const gdprUrlTR = @" https://gdpr.tr.adjust.com" ;
31+ static NSString * const subscriptionUrlTR = @" https://subscription.tr.adjust.com" ;
32+
33+ static NSString * const baseUrlUS = @" https://app.us.adjust.com" ;
34+ static NSString * const gdprUrlUS = @" https://gdpr.us.adjust.com" ;
35+ static NSString * const subscriptionUrlUS = @" https://subscription.us.adjust.com" ;
36+
2537@interface ADJUrlStrategy ()
2638
2739@property (nonatomic , copy ) NSArray <NSString *> *baseUrlChoicesArray;
@@ -71,6 +83,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
7183 return @[baseUrlIndia, baseUrl];
7284 } else if ([urlStrategyInfo isEqualToString: ADJUrlStrategyChina]) {
7385 return @[baseUrlChina, baseUrl];
86+ } else if ([urlStrategyInfo isEqualToString: ADJDataResidencyEU]) {
87+ return @[baseUrlEU];
7488 } else {
7589 return @[baseUrl, baseUrlIndia, baseUrlChina];
7690 }
@@ -82,6 +96,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
8296 return @[gdprUrlIndia, gdprUrl];
8397 } else if ([urlStrategyInfo isEqualToString: ADJUrlStrategyChina]) {
8498 return @[gdprUrlChina, gdprUrl];
99+ } else if ([urlStrategyInfo isEqualToString: ADJDataResidencyEU]) {
100+ return @[gdprUrlEU];
85101 } else {
86102 return @[gdprUrl, gdprUrlIndia, gdprUrlChina];
87103 }
@@ -93,6 +109,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
93109 return @[subscritionUrlIndia, subscriptionUrl];
94110 } else if ([urlStrategyInfo isEqualToString: ADJUrlStrategyChina]) {
95111 return @[subscritionUrlChina, subscriptionUrl];
112+ } else if ([urlStrategyInfo isEqualToString: ADJDataResidencyEU]) {
113+ return @[subscriptionUrlEU];
96114 } else {
97115 return @[subscriptionUrl, subscritionUrlIndia, subscritionUrlChina];
98116 }
@@ -125,12 +143,21 @@ - (void)resetAfterSuccess {
125143 self.wasLastAttemptSuccess = YES ;
126144}
127145
128- - (BOOL )shouldRetryAfterFailure {
129- NSUInteger nextChoiceIndex = (self.choiceIndex + 1 ) % self.baseUrlChoicesArray .count ;
130- self.choiceIndex = nextChoiceIndex;
131-
146+ - (BOOL )shouldRetryAfterFailure : (ADJActivityKind)activityKind {
132147 self.wasLastAttemptSuccess = NO ;
133148
149+ NSUInteger choiceListSize;
150+ if (activityKind == ADJActivityKindGdpr) {
151+ choiceListSize = [_gdprUrlChoicesArray count ];
152+ } else if (activityKind == ADJActivityKindSubscription) {
153+ choiceListSize = [_subscriptionUrlChoicesArray count ];
154+ } else {
155+ choiceListSize = [_baseUrlChoicesArray count ];
156+ }
157+
158+ NSUInteger nextChoiceIndex = (self.choiceIndex + 1 ) % choiceListSize;
159+ self.choiceIndex = nextChoiceIndex;
160+
134161 BOOL nextChoiceHasNotReturnedToStartingChoice = self.choiceIndex != self.startingChoiceIndex ;
135162 return nextChoiceHasNotReturnedToStartingChoice;
136163}
0 commit comments