Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.27.0 #514

Merged
merged 20 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Adjust"
s.version = "4.26.1"
s.version = "4.27.0"
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
s.homepage = "https://github.com/adjust/ios_sdk"
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
s.author = { "Christian Wellenbrock" => "[email protected]" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.26.1" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.27.0" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
8 changes: 5 additions & 3 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -1725,9 +1725,11 @@ - (BOOL)shouldFetchAdServicesI:(ADJActivityHandler *)selfI {
- (void)checkForAdServicesAttributionI:(ADJActivityHandler *)selfI {
if (@available(iOS 14.3, tvOS 14.3, *)) {
if ([selfI shouldFetchAdServicesI:selfI]) {
NSError *error = nil;
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
[selfI setAdServicesAttributionToken:token error:error];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSError *error = nil;
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
[selfI setAdServicesAttributionToken:token error:error];
});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ - (NSMutableDictionary *)getMeasurementConsentParameters:(BOOL)enabled {
NSString *enableValue = enabled ? @"enable" : @"disable";
[ADJPackageBuilder parameters:parameters
setString:enableValue
forKey:@"sharing"];
forKey:@"measurement"];

if ([self.trackingStatusManager canGetAttStatus]) {
[ADJPackageBuilder parameters:parameters setInt:self.trackingStatusManager.attStatus
Expand Down
7 changes: 5 additions & 2 deletions Adjust/ADJRequestHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ - (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request
[self.logger debug:@"Request succeeded with current URL strategy"];
[self.urlStrategy resetAfterSuccess];
[self.responseCallback responseCallback:responseData];
} else if ([self.urlStrategy shouldRetryAfterFailure]) {
} else if ([self.urlStrategy shouldRetryAfterFailure:responseData.activityKind]) {
[self.logger debug:@"Request failed with current URL strategy, but it will be retried with new one"];
[self retryWithResponseData:responseData
methodTypeInfo:methodTypeInfo];
Expand Down Expand Up @@ -260,7 +260,7 @@ - (void)sendNSURLConnectionRequest:(NSMutableURLRequest *)request
[self.logger debug:@"succeeded with current url strategy"];
[self.urlStrategy resetAfterSuccess];
[self.responseCallback responseCallback:responseData];
} else if ([self.urlStrategy shouldRetryAfterFailure]) {
} else if ([self.urlStrategy shouldRetryAfterFailure:responseData.activityKind]) {
[self.logger debug:@"failed with current url strategy, but it will retry with new"];
[self retryWithResponseData:responseData
methodTypeInfo:methodTypeInfo];
Expand Down Expand Up @@ -393,6 +393,9 @@ - (void)handleResponseWithData:(NSData *)data
NSString *urlString =
[NSString stringWithFormat:@"%@%@%@?%@",
urlHostString, self.urlStrategy.extraPath, path, queryStringParameters];

[self.logger verbose:@"Sending request to endpoint: %@",
[NSString stringWithFormat:@"%@%@%@", urlHostString, self.urlStrategy.extraPath, path]];

// [self.logger verbose:@"requestForGetPackage with urlString: %@", urlString];

Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJUrlStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
- (NSString *)getUrlHostStringByPackageKind:(ADJActivityKind)activityKind;

- (void)resetAfterSuccess;
- (BOOL)shouldRetryAfterFailure;
- (BOOL)shouldRetryAfterFailure:(ADJActivityKind)activityKind;

@end
35 changes: 31 additions & 4 deletions Adjust/ADJUrlStrategy.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
static NSString * const gdprUrlChina = @"https://gdpr.adjust.world";
static NSString * const subscritionUrlChina = @"https://subscription.adjust.world";

static NSString * const baseUrlEU = @"https://app.eu.adjust.com";
static NSString * const gdprUrlEU = @"https://gdpr.eu.adjust.com";
static NSString * const subscriptionUrlEU = @"https://subscription.eu.adjust.com";

static NSString * const baseUrlTR = @"https://app.tr.adjust.com";
static NSString * const gdprUrlTR = @"https://gdpr.tr.adjust.com";
static NSString * const subscriptionUrlTR = @"https://subscription.tr.adjust.com";

static NSString * const baseUrlUS = @"https://app.us.adjust.com";
static NSString * const gdprUrlUS = @"https://gdpr.us.adjust.com";
static NSString * const subscriptionUrlUS = @"https://subscription.us.adjust.com";

@interface ADJUrlStrategy ()

@property (nonatomic, copy) NSArray<NSString *> *baseUrlChoicesArray;
Expand Down Expand Up @@ -71,6 +83,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[baseUrlIndia, baseUrl];
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
return @[baseUrlChina, baseUrl];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
return @[baseUrlEU];
} else {
return @[baseUrl, baseUrlIndia, baseUrlChina];
}
Expand All @@ -82,6 +96,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[gdprUrlIndia, gdprUrl];
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
return @[gdprUrlChina, gdprUrl];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
return @[gdprUrlEU];
} else {
return @[gdprUrl, gdprUrlIndia, gdprUrlChina];
}
Expand All @@ -93,6 +109,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[subscritionUrlIndia, subscriptionUrl];
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
return @[subscritionUrlChina, subscriptionUrl];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
return @[subscriptionUrlEU];
} else {
return @[subscriptionUrl, subscritionUrlIndia, subscritionUrlChina];
}
Expand Down Expand Up @@ -125,12 +143,21 @@ - (void)resetAfterSuccess {
self.wasLastAttemptSuccess = YES;
}

- (BOOL)shouldRetryAfterFailure {
NSUInteger nextChoiceIndex = (self.choiceIndex + 1) % self.baseUrlChoicesArray.count;
self.choiceIndex = nextChoiceIndex;

- (BOOL)shouldRetryAfterFailure:(ADJActivityKind)activityKind {
self.wasLastAttemptSuccess = NO;

NSUInteger choiceListSize;
if (activityKind == ADJActivityKindGdpr) {
choiceListSize = [_gdprUrlChoicesArray count];
} else if (activityKind == ADJActivityKindSubscription) {
choiceListSize = [_subscriptionUrlChoicesArray count];
} else {
choiceListSize = [_baseUrlChoicesArray count];
}

NSUInteger nextChoiceIndex = (self.choiceIndex + 1) % choiceListSize;
self.choiceIndex = nextChoiceIndex;

BOOL nextChoiceHasNotReturnedToStartingChoice = self.choiceIndex != self.startingChoiceIndex;
return nextChoiceHasNotReturnedToStartingChoice;
}
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
static CTTelephonyNetworkInfo *networkInfo = nil;
#endif

static NSString * const kClientSdk = @"ios4.26.1";
static NSString * const kClientSdk = @"ios4.27.0";
static NSString * const kDeeplinkParam = @"deep_link=";
static NSString * const kSchemeDelimiter = @"://";
static NSString * const kDefaultScheme = @"AdjustUniversalScheme";
Expand Down
3 changes: 2 additions & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Adjust.h
// Adjust
//
// V4.26.1
// V4.27.0
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
//
Expand Down Expand Up @@ -67,6 +67,7 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
*/
extern NSString * __nonnull const ADJUrlStrategyIndia;
extern NSString * __nonnull const ADJUrlStrategyChina;
extern NSString * __nonnull const ADJDataResidencyEU;

/**
* @brief The main interface to Adjust.
Expand Down
1 change: 1 addition & 0 deletions Adjust/Adjust.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

NSString * const ADJUrlStrategyIndia = @"UrlStrategyIndia";
NSString * const ADJUrlStrategyChina = @"UrlStrategyChina";
NSString * const ADJDataResidencyEU = @"DataResidencyEU";

@implementation AdjustTestOptions
@end
Expand Down
3 changes: 2 additions & 1 deletion AdjustBridge/AdjustBridgeRegister.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ + (NSString *)adjust_js {
if (this.sdkPrefix) {
return this.sdkPrefix;
} else {
return 'web-bridge4.26.1';
return 'web-bridge4.27.0';
}
},
setTestOptions: function(testOptions) {
Expand Down Expand Up @@ -361,6 +361,7 @@ + (NSString *)adjust_js {

AdjustConfig.UrlStrategyIndia = 'UrlStrategyIndia';
AdjustConfig.UrlStrategyChina = 'UrlStrategyChina';
AdjustConfig.DataResidencyEU = 'DataResidencyEU';

AdjustConfig.prototype.registerCallbackHandlers = function() {
var registerCallbackHandler = function(callbackName) {
Expand Down
2 changes: 1 addition & 1 deletion AdjustTests/AdjustUnitTests/ADJPackageFields.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ - (id) init {

// default values
self.appToken = @"qwerty123456";
self.clientSdk = @"ios4.26.1";
self.clientSdk = @"ios4.27.0";
self.suffix = @"";
self.environment = @"sandbox";

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Version 4.27.0 (17th March 2021)

#### Added
- Added data residency feature. Support for EU data residency region is added. You can choose this setting by calling `setUrlStrategy:` method of `ADJConfig` instance with `ADJDataResidencyEU` parameter.

#### Changed
- Changed the measurement consent parameter name from `sharing` to `measurement`.

---

### Version 4.26.1 (5th February 2021)

#### Fixed
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
* [Third-party sharing](#third-party-sharing)
* [Disable third-party sharing](#disable-third-party-sharing)
* [Enable third-party sharing](#enable-third-party-sharing)
* [Measurement consent](#measurement-consent)
* [Consent measurement](#measurement-consent)
* [SDK signature](#sdk-signature)
* [Background tracking](#background-tracking)
* [Device IDs](#device-ids)
Expand All @@ -60,6 +60,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
* [Deep linking on iOS 9 and later](#deeplinking-setup-new)
* [Deferred deep linking scenario](#deeplinking-deferred)
* [Reattribution via deep links](#deeplinking-reattribution)
* [Data residency](#data-residency)
* [Troubleshooting](#troubleshooting)
* [Issues with delayed SDK initialisation](#ts-delayed-init)
* [I'm seeing "Adjust requires ARC" error](#ts-arc)
Expand All @@ -83,13 +84,13 @@ We will describe the steps to integrate the Adjust SDK into your iOS project. We
If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate):

```ruby
pod 'Adjust', '~> 4.26.1'
pod 'Adjust', '~> 4.27.0'
```

or:

```ruby
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.26.1'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.27.0'
```

---
Expand Down Expand Up @@ -128,8 +129,8 @@ If you are having `iMessage` app, you can use the Adjust SDK with it as well wit
Adjust SDK is able to get additional information in case you link additional iOS frameworks to your app. Please, add following frameworks in case you want to enable Adjust SDK features based on their presence in your app and mark them as optional:

- `AdSupport.framework` - This framework is needed so that SDK can access to IDFA value and (prior to iOS 14) LAT information.
- `iAd.framework` - This framework is needed so that SDK can automatically handle attribution for ASA campaings you might be running (to be deprecated in the future in favour of `AdServices.framework`).
- `AdServices.framework` - This framework is needed so that SDK can automatically handle attribution for ASA campaings you might be running.
- `iAd.framework` - This framework is needed so that SDK can automatically handle attribution for ASA campaigns you might be running (to be deprecated in the future in favour of `AdServices.framework`).
- `AdServices.framework` - This framework is needed so that SDK can automatically handle attribution for ASA campaigns you might be running.
- `CoreTelephony.framework` - This framework is needed so that SDK can determine current radio access technology.
- `StoreKit.framework` - This framework is needed for access to `SKAdNetwork` framework and for Adjust SDK to handle communication with it automatically in iOS 14 or later.
- `AppTrackingTransparency.framework` - This framework is needed in iOS 14 and later for SDK to be able to wrap user's tracking consent dialog and access to value of the user's consent to be tracked or not.
Expand Down Expand Up @@ -771,7 +772,7 @@ You can notify Adjust when a user disables, enables, and re-enables data sharing
Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend:

```objc
ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:NO];
ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@NO];
[Adjust trackThirdPartySharing:adjustThirdPartySharing];
```

Expand All @@ -782,7 +783,7 @@ Upon receiving this information, Adjust will block the sharing of that specific
Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend:

```objc
ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:YES];
ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@YES];
[Adjust trackThirdPartySharing:adjustThirdPartySharing];
```

Expand All @@ -798,9 +799,9 @@ ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] in

### <a id="measurement-consent"></a>Consent measurement for specific users

You can notify Adjust when a user exercises their right to change data sharing with partners for marketing purposes, but they allow data sharing for statistical purposes.
To enable or disable the Data Privacy settings in the Adjust Dashboard, including the consent expiry period and the user data retention period, you need to implement the below method.

Call the following method to instruct the Adjust SDK to communicate the user's choice to change data sharing, to the Adjust backend:
Call the following method to instruct the Adjust SDK to communicate the Data Privacy settings, to the Adjust backend:

```objc
[Adjust trackMeasurementConsent:YES];
Expand Down Expand Up @@ -1038,6 +1039,12 @@ The call to `appWillOpenUrl` should be done like this to support deep linking re
}
```

### <a id="data-residency"></a>Data residency

In order to enable data residency feature, make sure to make a call to `setUrlStrategy:` method of the `ADJConfig` instance with one of the following constants:

- `ADJDataResidencyEU` for EU data residency region.

## <a id="troubleshooting"></a>Troubleshooting

### <a id="ts-delayed-init"></a>Issues with delayed SDK initialisation
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.26.1
4.27.0
15 changes: 8 additions & 7 deletions doc/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
如果您正在使用[CocoaPods][cocoapods],您可以将以下代码行添加至 `Podfile`,然后继续进行[此步骤](#sdk-integrate):

```ruby
pod 'Adjust', '~> 4.26.1'
pod 'Adjust', '~> 4.27.0'
```

或:

```ruby
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.26.1'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.27.0'
```

---
Expand Down Expand Up @@ -111,12 +111,13 @@ github "adjust/ios_sdk"

### <a id="sdk-frameworks"></a>添加 iOS 框架

如果您关联额外的 iOS 框架到应用中,Adjust SDK 将能获取更多的信息。请根据应用启用 Adjust SDK 功能的情况,添加下列框架:
如果您关联额外的 iOS 框架到应用中,Adjust SDK 将能获取更多的信息。请根据应用启用 Adjust SDK 功能的情况,添加下列框架,并将其标记为 "可选" (optional)

- `AdSupport.framework` - 如果您希望 SDK 能访问 IDFA 值和 (iOS 14 以前) LAT 信息,请添加该框架。
- `iAd.framework` - 如果您希望 SDK 自动处理您的 ASA 推广活动归因数据,请添加该框架。
- `CoreTelephony.framework`- 如果您希望 SDK 能辨识当前的无线接入技术,请添加该框架。
- `StoreKit.framework`- 如果您希望访问 `SKAdNetwork` 框架,同时让 Adjust SDK 在 iOS 14 或未来版本的 iOS 中自动处理与该框架的通讯,请添加该框架。
- `AdSupport.framework` - 请务必添加该框架,让SDK 能访问 IDFA 值和 (iOS 14 以前的) LAT 信息。
- `iAd.framework` - 如果您希望 SDK 自动处理您的 ASA 推广活动归因数据,请添加该框架 (未来将替换为 `AdServices.framework`)。
- `AdServices.framework`- 如果您希望 SDK 自动处理您的 ASA 推广活动归因数据,请添加该框架。
- `CoreTelephony.framework`- 如果您希望 SDK 能辨识当前的无线接入技术 (radio access),请添加该框架。
- `StoreKit.framework`- 如果您希望访问 `SKAdNetwork` 框架,同时让 Adjust SDK 在 iOS 14 或未来版本的 iOS 中自动处理与`SKAdNetwork` 的通讯,请添加该框架。
- `AppTrackingTransparency.framework` - 如果您希望 SDK 能在 iOS 14 或未来版本的 iOS 中包装用户的跟踪许可对话框,并访问用户跟踪许可的值,请添加该框架。

### <a id="sdk-integrate"></a>集成SDK至您的应用
Expand Down
2 changes: 1 addition & 1 deletion doc/english/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your Adjust SDK for iOS to v4.26.1 from v3.4.0
## Migrate your Adjust SDK for iOS to v4.27.0 from v3.4.0

### Initial setup

Expand Down
2 changes: 1 addition & 1 deletion doc/english/web_views.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ We will describe the steps to integrate the Adjust SDK into your iOS project. We
If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate):

```ruby
pod 'Adjust/WebBridge', '~> 4.26.1'
pod 'Adjust/WebBridge', '~> 4.27.0'
```

---
Expand Down
5 changes: 3 additions & 2 deletions doc/japanese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ adjust SDKをiOSプロジェクトに連携する手順を説明します。
[こちらの手順](#sdk-integrate)に進んでください。

```ruby
pod 'Adjust', '~> 4.26.1'
pod 'Adjust', '~> 4.27.0'
```

または

```ruby
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.26.1'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.27.0'
```

---
Expand Down Expand Up @@ -68,6 +68,7 @@ StaticかDynamicフレームワークを選択し、プロジェクトに追加

- `AdSupport.framework` - SDKがIDFA値および(iOS 14より前の)LAT情報を呼び出せるようにします。
- `iAd.framework` - SDKが実行中のASAキャンペーンのアトリビューションを自動的に処理できるようにします。
- `AdServices.framework`- SDKが実行中のASAキャンペーンのアトリビューションを自動的に処理できるようにします。
- `CoreTelephony.framework`- SDKが現在のRadio Access Technology(無線アクセス技術)を判別できるようにします。
- `StoreKit.framework`- iOS 14またはそれ以降において、このフレームワークは「SKAdNetwork」のフレームワークにアクセスし、「SKAdNetwork」との通信をAdjust SDKで自動的に処理できるようにします。
- `AppTrackingTransparency.framework` -iOS 14またはそれ以降において、このフレームワークはSDKがトラッキングに対するユーザー同意を確認するダイアログをラップし、ユーザーの許諾状況を示す値にアクセスできるようにします。
Expand Down
Loading