Skip to content

Commit

Permalink
Merge pull request #561 from adjust/v4295
Browse files Browse the repository at this point in the history
Version 4.29.5
  • Loading branch information
uerceg authored Aug 20, 2021
2 parents 5ae9648 + 0a1dc74 commit 340a26c
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 30 deletions.
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.29.4"
s.version = "4.29.5"
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.29.4" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.29.5" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
27 changes: 17 additions & 10 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig
[self readAttribution];
[self readActivityState];

// register SKAdNetwork attribution
[self registerForSKAdNetworkAttribution];
// register SKAdNetwork attribution if we haven't already
if ([ADJUserDefaults getSkadRegisterCallTimestamp] == nil) {
[self registerForSKAdNetworkAttribution];
} else {
[ADJAdjustFactory.logger debug:@"Call to SKAdNetwork's registerAppForAdNetworkAttribution method already made for this install"];
}

self.internalState = [[ADJInternalState alloc] init];

Expand Down Expand Up @@ -1004,14 +1008,6 @@ - (void)initI:(ADJActivityHandler *)selfI
userAgent:selfI.adjustConfig.userAgent
urlStrategy:sdkClickHandlerUrlStrategy];

if (selfI.adjustConfig.allowiAdInfoReading == YES) {
[selfI checkForiAdI:selfI];
}

if (selfI.adjustConfig.allowAdServicesInfoReading == YES) {
[selfI checkForAdServicesAttributionI:selfI];
}

[selfI.trackingStatusManager checkForNewAttStatus];

[selfI preLaunchActionsI:selfI
Expand Down Expand Up @@ -1105,6 +1101,13 @@ - (void)processSessionI:(ADJActivityHandler *)selfI {
selfI.activityState.updatePackages = [selfI.internalState itHasToUpdatePackages];
}];

if (selfI.adjustConfig.allowiAdInfoReading == YES) {
[selfI checkForiAdI:selfI];
}
if (selfI.adjustConfig.allowAdServicesInfoReading == YES) {
[selfI checkForAdServicesAttributionI:selfI];
}

[selfI writeActivityStateI:selfI];
[ADJUserDefaults removePushToken];
[ADJUserDefaults removeDisableThirdPartySharing];
Expand Down Expand Up @@ -2753,6 +2756,10 @@ - (void)registerForSKAdNetworkAttribution {
[skAdNetwork performSelector:registerAttributionSelector];
#pragma clang diagnostic pop
[logger verbose:@"Call to SKAdNetwork's registerAppForAdNetworkAttribution method made"];

// store timestamp of when register call was successfully made
NSDate *callTime = [NSDate date];
[ADJUserDefaults saveSkadRegisterCallTimestamp:callTime];
}
}

Expand Down
14 changes: 13 additions & 1 deletion Adjust/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ - (void)signWithSigV2Plugin:(ADJActivityPackage *)activityPackage {
const char *sdkVersionChar = [activityPackage.clientSdk UTF8String];

// Stack allocated strings to ensure their lifetime stays until the next iteration
static char activityKind[51], sdkVersion[21];
static char activityKind[64], sdkVersion[64];
strncpy(activityKind, activityKindChar, strlen(activityKindChar) + 1);
strncpy(sdkVersion, sdkVersionChar, strlen(sdkVersionChar) + 1);

Expand Down Expand Up @@ -381,6 +381,7 @@ - (NSMutableDictionary *)getSessionParameters:(BOOL)isInDelay {
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if ([self.trackingStatusManager canGetAttStatus]) {
Expand Down Expand Up @@ -447,6 +448,7 @@ - (NSMutableDictionary *)getEventParameters:(BOOL)isInDelay forEventPackage:(ADJ
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setNumber:event.revenue forKey:@"revenue"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if ([self.trackingStatusManager canGetAttStatus]) {
Expand Down Expand Up @@ -534,6 +536,7 @@ - (NSMutableDictionary *)getInfoParameters:(NSString *)source {
[ADJPackageBuilder parameters:parameters setDictionary:[self.sessionParameters.partnerParameters copy] forKey:@"partner_params"];
[ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];
[ADJPackageBuilder parameters:parameters setString:source forKey:@"source"];

Expand Down Expand Up @@ -600,6 +603,7 @@ - (NSMutableDictionary *)getAdRevenueParameters:(NSString *)source payload:(NSDa
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];
[ADJPackageBuilder parameters:parameters setString:source forKey:@"source"];
[ADJPackageBuilder parameters:parameters setData:payload forKey:@"payload"];
Expand Down Expand Up @@ -660,6 +664,7 @@ - (NSMutableDictionary *)getAdRevenueParameters:(ADJAdRevenue *)adRevenue isInDe
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

[ADJPackageBuilder parameters:parameters setString:adRevenue.source forKey:@"source"];
Expand Down Expand Up @@ -745,6 +750,7 @@ - (NSMutableDictionary *)getClickParameters:(NSString *)source {
[ADJPackageBuilder parameters:parameters setDictionary:[self.sessionParameters.partnerParameters copy] forKey:@"partner_params"];
[ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];
[ADJPackageBuilder parameters:parameters setString:source forKey:@"source"];

Expand Down Expand Up @@ -810,6 +816,7 @@ - (NSMutableDictionary *)getAttributionParameters:(NSString *)initiatedBy {
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if (self.adjustConfig.isDeviceKnown) {
Expand Down Expand Up @@ -860,6 +867,7 @@ - (NSMutableDictionary *)getGdprParameters {
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if (self.adjustConfig.isDeviceKnown) {
Expand Down Expand Up @@ -919,6 +927,7 @@ - (NSMutableDictionary *)getDisableThirdPartySharingParameters {
[ADJPackageBuilder parameters:parameters setDictionary:[self.sessionParameters.partnerParameters copy] forKey:@"partner_params"];
[ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if ([self.trackingStatusManager canGetAttStatus]) {
Expand Down Expand Up @@ -984,6 +993,7 @@ - (NSMutableDictionary *)getThirdPartySharingParameters:(nonnull ADJThirdPartySh
[ADJPackageBuilder parameters:parameters setDictionary:[self.sessionParameters.partnerParameters copy] forKey:@"partner_params"];
[ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

// Third Party Sharing
Expand Down Expand Up @@ -1055,6 +1065,7 @@ - (NSMutableDictionary *)getMeasurementConsentParameters:(BOOL)enabled {
[ADJPackageBuilder parameters:parameters setDictionary:[self.sessionParameters.partnerParameters copy] forKey:@"partner_params"];
[ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

// Measurement Consent
Expand Down Expand Up @@ -1114,6 +1125,7 @@ - (NSMutableDictionary *)getSubscriptionParameters:(BOOL)isInDelay forSubscripti
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osName forKey:@"os_name"];
[ADJPackageBuilder parameters:parameters setString:self.packageParams.osVersion forKey:@"os_version"];
[ADJPackageBuilder parameters:parameters setString:self.adjustConfig.secretId forKey:@"secret_id"];
[ADJPackageBuilder parameters:parameters setDate:[ADJUserDefaults getSkadRegisterCallTimestamp] forKey:@"skadn_registered_at"];
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

if ([self.trackingStatusManager canGetAttStatus]) {
Expand Down
7 changes: 7 additions & 0 deletions Adjust/ADJUserDefaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@
+ (void)clearAdjustStuff;

+ (void)saveiAdErrorKey:(NSString *)key;

+ (NSDictionary<NSString *, NSNumber *> *)getiAdErrors;

+ (void)cleariAdErrors;

+ (void)setAdServicesTracked;

+ (BOOL)getAdServicesTracked;

+ (void)saveSkadRegisterCallTimestamp:(NSDate *)callTime;

+ (NSDate *)getSkadRegisterCallTimestamp;

@end
10 changes: 10 additions & 0 deletions Adjust/ADJUserDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
static NSString * const PREFS_KEY_DISABLE_THIRD_PARTY_SHARING = @"adj_disable_third_party_sharing";
static NSString * const PREFS_KEY_IAD_ERRORS = @"adj_iad_errors";
static NSString * const PREFS_KEY_ADSERVICES_TRACKED = @"adj_adservices_tracked";
static NSString * const PREFS_KEY_SKAD_REGISTER_CALL_TIME = @"adj_skad_register_call_time";

@implementation ADJUserDefaults

Expand Down Expand Up @@ -129,6 +130,14 @@ + (BOOL)getAdServicesTracked {
return [[NSUserDefaults standardUserDefaults] boolForKey:PREFS_KEY_ADSERVICES_TRACKED];
}

+ (void)saveSkadRegisterCallTimestamp:(NSDate *)callTime {
[[NSUserDefaults standardUserDefaults] setObject:callTime forKey:PREFS_KEY_SKAD_REGISTER_CALL_TIME];
}

+ (NSDate *)getSkadRegisterCallTimestamp {
return [[NSUserDefaults standardUserDefaults] objectForKey:PREFS_KEY_SKAD_REGISTER_CALL_TIME];
}

+ (void)clearAdjustStuff {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_PUSH_TOKEN_DATA];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_PUSH_TOKEN_STRING];
Expand All @@ -139,6 +148,7 @@ + (void)clearAdjustStuff {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_DISABLE_THIRD_PARTY_SHARING];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_IAD_ERRORS];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_ADSERVICES_TRACKED];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PREFS_KEY_SKAD_REGISTER_CALL_TIME];
}

@end
2 changes: 1 addition & 1 deletion Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
static NSRegularExpression *shortUniversalLinkRegex = nil;
static NSRegularExpression *excludedDeeplinkRegex = nil;

static NSString * const kClientSdk = @"ios4.29.4";
static NSString * const kClientSdk = @"ios4.29.5";
static NSString * const kDeeplinkParam = @"deep_link=";
static NSString * const kSchemeDelimiter = @"://";
static NSString * const kDefaultScheme = @"AdjustUniversalScheme";
Expand Down
2 changes: 1 addition & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Adjust.h
// Adjust SDK
//
// V4.29.4
// V4.29.5
// Created by Christian Wellenbrock (@wellle) on 23rd July 2013.
// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved.
//
Expand Down
2 changes: 1 addition & 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.29.4';
return 'web-bridge4.29.5';
}
},
setTestOptions: function(testOptions) {
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.29.4";
self.clientSdk = @"ios4.29.5";
self.suffix = @"";
self.environment = @"sandbox";

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Version 4.29.5 (19th August 2021)
#### Added
- Added sending of information when was the call to `registerAppForAdNetworkAttribution` method made.

#### Fixed
- Fixed issue with insufficient buffer size for storing SDK prefix (https://github.com/adjust/react_native_sdk/issues/140).

---

### Version 4.29.4 (9th August 2021)
#### Fixed
- Fixed new Xcode 13 beta compile time errors for extensions targets (https://github.com/adjust/ios_sdk/pull/559).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,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.29.4'
pod 'Adjust', '~> 4.29.5'
```

or:

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

---
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.29.4
4.29.5
4 changes: 2 additions & 2 deletions doc/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
如果您正在使用 [CocoaPods][cocoapods],可以将以下代码行添加至 `Podfile`,然后继续进行[此步骤](#sdk-integrate):

```ruby
pod 'Adjust', '~> 4.29.4'
pod 'Adjust', '~> 4.29.5'
```

或:

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

---
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.29.4 from v3.4.0
## Migrate your Adjust SDK for iOS to v4.29.5 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.29.4'
pod 'Adjust/WebBridge', '~> 4.29.5'
```

---
Expand Down
4 changes: 2 additions & 2 deletions doc/japanese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ Adjust SDKをiOSプロジェクトに導入する手順を説明します。Xcod
[CocoaPods][cocoapods]を使用している場合は、Podfile`に下記のコードを追加し、[こちらの手順](#sdk-integrate)に進んでください。

```ruby
pod 'Adjust', '~> 4.29.4'
pod 'Adjust', '~> 4.29.5'
```

または

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

---
Expand Down
4 changes: 2 additions & 2 deletions doc/korean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ iOS 개발용 Xcode를 사용한다는 가정하에 iOS 프로젝트에 Adjust S
[CocoaPods][cocoapods]를 사용하는 경우, 다음 내용을 `Podfile`에 추가한 후 [해당 단계](#sdk-integrate)를 완료하세요.

```ruby
pod `Adjust`, `~> 4.29.4`
pod `Adjust`, `~> 4.29.5`
```

또는:

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

---
Expand Down
2 changes: 1 addition & 1 deletion doc/korean/web_views.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ iOS 개발용 Xcode를 사용한다는 가정하에 iOS 프로젝트에 Adjust S
[CocoaPods][cocoapods]를 사용하는 경우, 다음 내용을 'Podfile'에 추가한 후 [해당 단계](#sdk-integrate)를 완료하세요.

```ruby
pod 'Adjust/WebBridge', '~> 4.29.4'
pod 'Adjust/WebBridge', '~> 4.29.5'
```

---
Expand Down
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your Adjust SDK for iOS to v4.29.4 from v3.4.0
## Migrate your Adjust SDK for iOS to v4.29.5 from v3.4.0

### Initial setup

Expand Down

0 comments on commit 340a26c

Please sign in to comment.