Skip to content

Commit 0ebd22e

Browse files
authored
Merge pull request #119 from adjust/v4280
Version 4.28.0
2 parents 09882f1 + abab898 commit 0ebd22e

35 files changed

+1453
-1576
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Version 4.28.0 (1th April 2021)
2+
#### Changed
3+
- Removed native iOS legacy code.
4+
5+
#### Native SDKs
6+
- [[email protected]][ios_sdk_v4.28.0]
7+
- [[email protected]][android_sdk_v4.27.0]
8+
9+
---
10+
111
### Version 4.26.0 (18th February 2021)
212
#### Added
313
- Added possibility to get cost data information in attribution callback.
@@ -400,6 +410,7 @@
400410
[ios_sdk_v4.23.0]: https://github.com/adjust/ios_sdk/tree/v4.23.0
401411
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
402412
[ios_sdk_v4.26.1]: https://github.com/adjust/ios_sdk/tree/v4.26.1
413+
[ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0
403414

404415
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
405416
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
@@ -423,3 +434,4 @@
423434
[android_sdk_v4.24.0]: https://github.com/adjust/android_sdk/tree/v4.24.0
424435
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
425436
[android_sdk_v4.26.2]: https://github.com/adjust/android_sdk/tree/v4.26.2
437+
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.26.0
1+
4.28.0

android/libs/adjust-android.jar

2.86 KB
Binary file not shown.

example/ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PODS:
2-
- Adjust (4.26.1):
3-
- Adjust/Core (= 4.26.1)
4-
- Adjust/Core (4.26.1)
2+
- Adjust (4.28.0):
3+
- Adjust/Core (= 4.28.0)
4+
- Adjust/Core (4.28.0)
55
- boost-for-react-native (1.63.0)
66
- DoubleConversion (1.1.6)
77
- EXApplication (2.4.1):
@@ -227,8 +227,8 @@ PODS:
227227
- React-cxxreact (= 0.63.4)
228228
- React-jsi (= 0.63.4)
229229
- React-jsinspector (0.63.4)
230-
- react-native-adjust (4.26.0):
231-
- Adjust (= 4.26.1)
230+
- react-native-adjust (4.28.0):
231+
- Adjust (= 4.28.0)
232232
- React
233233
- React-RCTActionSheet (0.63.4):
234234
- React-Core/RCTActionSheetHeaders (= 0.63.4)
@@ -292,7 +292,7 @@ PODS:
292292
- React-jsi (= 0.63.4)
293293
- RNGestureHandler (1.8.0):
294294
- React
295-
- RNReanimated (1.13.2):
295+
- RNReanimated (1.13.3):
296296
- React-Core
297297
- RNScreens (2.15.2):
298298
- React-Core
@@ -498,7 +498,7 @@ EXTERNAL SOURCES:
498498
:path: "../node_modules/react-native/ReactCommon/yoga"
499499

500500
SPEC CHECKSUMS:
501-
Adjust: e8f9b8b50b3d234923389f8e0077ce911cf502d8
501+
Adjust: 131c77905f67b26e946d1b831fad20ed2b41134c
502502
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
503503
DoubleConversion: cde416483dac037923206447da6e1454df403714
504504
EXApplication: e3c201e7b913d081bbd37bd3c5d0e2cdc21733b4
@@ -529,7 +529,7 @@ SPEC CHECKSUMS:
529529
React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31
530530
React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949
531531
React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a
532-
react-native-adjust: 26e155ca69b538c5c881610c37f85fc1ce1ffd09
532+
react-native-adjust: ffd658e43e26a7bf619554dc359a62b25bd01bf6
533533
React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
534534
React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
535535
React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0
@@ -541,7 +541,7 @@ SPEC CHECKSUMS:
541541
React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d
542542
ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
543543
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
544-
RNReanimated: e03f7425cb7a38dcf1b644d680d1bfc91c3337ad
544+
RNReanimated: 514a11da3a2bcc6c3dfd9de32b38e2b9bf101926
545545
RNScreens: 3d682bcaba69a4f8e55543d90818704f34338db1
546546
UMAppLoader: 92d044af52626af3d81a69796ad666fc7a9a7d78
547547
UMBarCodeScannerInterface: 3f6c1b09ef4b867ce752b8c0b3893bcf9cd85f32

example/yarn.lock

Lines changed: 654 additions & 595 deletions
Large diffs are not rendered by default.

ext/android/sdk

Submodule sdk updated 36 files

ext/ios/sdk

Submodule sdk updated 47 files

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Adjust.getAmazonAdId = function(callback) {
126126
};
127127

128128
Adjust.getSdkVersion = function(callback) {
129-
module_adjust.getSdkVersion("react-native4.26.0", callback);
129+
module_adjust.getSdkVersion("react-native4.28.0", callback);
130130
};
131131

132132
Adjust.setReferrer = function(referrer) {
@@ -228,7 +228,7 @@ Adjust.onPause = function(testParam) {
228228
// AdjustConfig
229229

230230
var AdjustConfig = function(appToken, environment) {
231-
this.sdkPrefix = "react-native4.26.0";
231+
this.sdkPrefix = "react-native4.28.0";
232232
this.appToken = appToken;
233233
this.environment = environment;
234234
this.logLevel = null;

ios/Adjust/ADJActivityHandler.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,9 +1725,11 @@ - (BOOL)shouldFetchAdServicesI:(ADJActivityHandler *)selfI {
17251725
- (void)checkForAdServicesAttributionI:(ADJActivityHandler *)selfI {
17261726
if (@available(iOS 14.3, tvOS 14.3, *)) {
17271727
if ([selfI shouldFetchAdServicesI:selfI]) {
1728-
NSError *error = nil;
1729-
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
1730-
[selfI setAdServicesAttributionToken:token error:error];
1728+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1729+
NSError *error = nil;
1730+
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
1731+
[selfI setAdServicesAttributionToken:token error:error];
1732+
});
17311733
}
17321734
}
17331735
}

ios/Adjust/ADJActivityState.m

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// Copyright (c) 2013 adjust GmbH. All rights reserved.
77
//
88

9-
#import "ADJKeychain.h"
109
#import "ADJAdjustFactory.h"
1110
#import "ADJActivityState.h"
1211
#import "UIDevice+ADJAdditions.h"
@@ -84,26 +83,7 @@ - (BOOL)findTransactionId:(NSString *)transactionId {
8483
#pragma mark - Private & helper methods
8584

8685
- (void)assignUuid:(NSString *)uuid {
87-
NSString *persistedUuid = [ADJKeychain valueForKeychainKey:@"adjust_uuid" service:@"deviceInfo"];
88-
89-
// Check if value exists in Keychain.
90-
if (persistedUuid != nil) {
91-
// Check if value has UUID format.
92-
if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuid]) {
93-
[[ADJAdjustFactory logger] verbose:@"Value read from the keychain"];
94-
95-
// Value written in keychain seems to have UUID format.
96-
self.uuid = persistedUuid;
97-
self.isPersisted = YES;
98-
return;
99-
}
100-
}
101-
102-
// At this point, UUID was not persisted in Keychain or if persisted, didn't have proper UUID format.
103-
// Since we don't have anything in the keychain, we'll use the passed UUID value.
104-
// Try to save that value to the keychain.
10586
self.uuid = uuid;
106-
self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_uuid" inService:@"deviceInfo"];
10787
}
10888

10989
- (NSString *)description {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// NSNumber+ADJAdditions.h
3+
// Adjust
4+
//
5+
// Created by Uglješa Erceg (@uerceg) on 26th March 2021.
6+
// Copyright (c) 2021 Adjust GmbH. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface NSNumber(ADJAdditions)
12+
13+
+ (BOOL)adjIsEqual:(NSNumber *)first toNumber:(NSNumber *)second;
14+
15+
@end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// NSNumber+ADJAdditions.m
3+
// Adjust
4+
//
5+
// Created by Uglješa Erceg (@uerceg) on 26th March 2021.
6+
// Copyright (c) 2021 Adjust GmbH. All rights reserved.
7+
//
8+
9+
#import "NSNumber+ADJAdditions.h"
10+
11+
@implementation NSNumber(ADJAdditions)
12+
13+
+ (BOOL)adjIsEqual:(NSNumber *)first toNumber:(NSNumber *)second {
14+
if (first == nil && second == nil) {
15+
return YES;
16+
}
17+
18+
return [first isEqualToNumber:second];
19+
}
20+
21+
@end

ios/Adjust/ADJAdditions/UIDevice+ADJAdditions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
- (NSString *)adjDeviceName;
2222
- (NSString *)adjCreateUuid;
2323
- (NSString *)adjVendorId;
24-
- (NSString *)adjDeviceId:(ADJDeviceInfo *)deviceInfo;
2524
- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler queue:(dispatch_queue_t)queue;
2625
- (NSString *)adjFetchAdServicesAttribution:(NSError **)errorPtr;
2726

ios/Adjust/ADJAdditions/UIDevice+ADJAdditions.m

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -214,111 +214,6 @@ - (NSString *)adjVendorId {
214214
return @"";
215215
}
216216

217-
- (NSString *)adjDeviceId:(ADJDeviceInfo *)deviceInfo {
218-
int languageMaxLength = 16;
219-
NSString *language = deviceInfo.languageCode;
220-
NSString *binaryLanguage = [ADJUtil stringToBinaryString:language];
221-
NSString *binaryLanguageFormatted = [ADJUtil enforceParameterLength:binaryLanguage withMaxlength:languageMaxLength];
222-
223-
int hardwareNameMaxLength = 48;
224-
NSString *hardwareName = deviceInfo.machineModel;
225-
NSString *binaryHardwareName = [ADJUtil stringToBinaryString:hardwareName];
226-
NSString *binaryHardwareNameFormatted = [ADJUtil enforceParameterLength:binaryHardwareName withMaxlength:hardwareNameMaxLength];
227-
228-
NSArray *versionParts = [deviceInfo.systemVersion componentsSeparatedByString:@"."];
229-
int osVersionMajor = [[versionParts objectAtIndex:0] intValue];
230-
int osVersionMinor = [[versionParts objectAtIndex:1] intValue];
231-
int osVersionPatch = [versionParts count] == 3 ? [[versionParts objectAtIndex:2] intValue] : 0;
232-
233-
int osVersionMajorMaxLength = 8;
234-
NSString *binaryOsVersionMajor = [ADJUtil decimalToBinaryString:osVersionMajor];
235-
NSString *binaryOsVersionMajorFormatted = [ADJUtil enforceParameterLength:binaryOsVersionMajor withMaxlength:osVersionMajorMaxLength];
236-
237-
int osVersionMinorMaxLength = 8;
238-
NSString *binaryOsVersionMinor = [ADJUtil decimalToBinaryString:osVersionMinor];
239-
NSString *binaryOsVersionMinorFormatted = [ADJUtil enforceParameterLength:binaryOsVersionMinor withMaxlength:osVersionMinorMaxLength];
240-
241-
int osVersionPatchMaxLength = 8;
242-
NSString *binaryOsVersionPatch = [ADJUtil decimalToBinaryString:osVersionPatch];
243-
NSString *binaryOsVersionPatchFormatted = [ADJUtil enforceParameterLength:binaryOsVersionPatch withMaxlength:osVersionPatchMaxLength];
244-
245-
int mccMaxLength = 24;
246-
NSString *mcc = [ADJUtil readMCC];
247-
NSString *binaryMcc = [ADJUtil stringToBinaryString:mcc];
248-
NSString *binaryMccFormatted = [ADJUtil enforceParameterLength:binaryMcc withMaxlength:mccMaxLength];
249-
250-
int mncMaxLength = 24;
251-
NSString *mnc = [ADJUtil readMNC];
252-
NSString *binaryMnc = [ADJUtil stringToBinaryString:mnc];
253-
NSString *binaryMncFormatted = [ADJUtil enforceParameterLength:binaryMnc withMaxlength:mncMaxLength];
254-
255-
int chargingStatusMaxLength = 8;
256-
NSUInteger chargingStatus = [ADJSystemProfile chargingStatus];
257-
NSString *binaryChargingStatus = [ADJUtil decimalToBinaryString:chargingStatus];
258-
NSString *binaryChargingStatusFormatted = [ADJUtil enforceParameterLength:binaryChargingStatus withMaxlength:chargingStatusMaxLength];
259-
260-
int batteryLevelMaxSize = 8;
261-
NSUInteger batteryLevel = [ADJSystemProfile batteryLevel];
262-
NSString *binaryBatteryLevel = [ADJUtil decimalToBinaryString:batteryLevel];
263-
NSString *binaryBatteryLevelFormatted = [ADJUtil enforceParameterLength:binaryBatteryLevel withMaxlength:batteryLevelMaxSize];
264-
265-
int totalSpaceMaxSize = 24;
266-
NSUInteger totalSpace = [ADJSystemProfile totalDiskSpace];
267-
NSString *binaryTotalSpace = [ADJUtil decimalToBinaryString:totalSpace];
268-
NSString *binaryTotalSpaceFormatted = [ADJUtil enforceParameterLength:binaryTotalSpace withMaxlength:totalSpaceMaxSize];
269-
270-
int freeSpaceMaxSize = 24;
271-
NSUInteger freeSpace = [ADJSystemProfile freeDiskSpace];
272-
NSString *binaryFreeSpace = [ADJUtil decimalToBinaryString:freeSpace];
273-
NSString *binaryFreeSpaceFormatted = [ADJUtil enforceParameterLength:binaryFreeSpace withMaxlength:freeSpaceMaxSize];
274-
275-
int systemUptimeMaxSize = 24;
276-
NSUInteger systemUptime = [ADJSystemProfile systemUptime];
277-
NSString *binarySystemUptime = [ADJUtil decimalToBinaryString:systemUptime];
278-
NSString *binarySystemUptimeFormatted = [ADJUtil enforceParameterLength:binarySystemUptime withMaxlength:systemUptimeMaxSize];
279-
280-
int lastBootTimeMaxSize = 32;
281-
NSUInteger lastBootTime = [ADJSystemProfile lastBootTime];
282-
NSString *binaryLastBootTime = [ADJUtil decimalToBinaryString:lastBootTime];
283-
NSString *binaryLastBootTimeFormatted = [ADJUtil enforceParameterLength:binaryLastBootTime withMaxlength:lastBootTimeMaxSize];
284-
285-
NSString *concatenated = [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@%@",
286-
binaryLanguageFormatted,
287-
binaryHardwareNameFormatted,
288-
binaryOsVersionMajorFormatted,
289-
binaryOsVersionMinorFormatted,
290-
binaryOsVersionPatchFormatted,
291-
binaryMccFormatted,
292-
binaryMncFormatted,
293-
binaryChargingStatusFormatted,
294-
binaryBatteryLevelFormatted,
295-
binaryTotalSpaceFormatted,
296-
binaryFreeSpaceFormatted,
297-
binarySystemUptimeFormatted,
298-
binaryLastBootTimeFormatted];
299-
300-
// make sure concatenated string length is multiple of 4
301-
if (concatenated.length % 4 != 0) {
302-
int numberOfBits = concatenated.length % 4;
303-
while (numberOfBits != 4) {
304-
concatenated = [@"0" stringByAppendingString:concatenated];
305-
numberOfBits += 1;
306-
}
307-
}
308-
309-
NSString *mParameter = @"";
310-
for (NSUInteger i = 0; i < concatenated.length; i += 4) {
311-
// get fourplet substring
312-
NSString *fourplet = [concatenated substringWithRange:NSMakeRange(i, 4)];
313-
// convert fourplet to decimal number
314-
long decimalFourplet = strtol([fourplet UTF8String], NULL, 2);
315-
// append hex value of fourplet to final parameter
316-
mParameter = [mParameter stringByAppendingString:[NSString stringWithFormat:@"%lX", decimalFourplet]];
317-
}
318-
319-
return mParameter;
320-
}
321-
322217
- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler queue:(dispatch_queue_t)queue {
323218
// if no tries for iad v3 left, stop trying
324219
id<ADJLogger> logger = [ADJAdjustFactory logger];

ios/Adjust/ADJAttribution.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
// Copyright (c) 2014 adjust GmbH. All rights reserved.
77
//
88

9+
#import "ADJUtil.h"
910
#import "ADJAttribution.h"
1011
#import "NSString+ADJAdditions.h"
11-
#import "ADJUtil.h"
12+
#import "NSNumber+ADJAdditions.h"
1213

1314
@implementation ADJAttribution
1415

@@ -73,8 +74,7 @@ - (BOOL)isEqualToAttribution:(ADJAttribution *)attribution {
7374
if (![NSString adjIsEqual:self.costType toString:attribution.costType]) {
7475
return NO;
7576
}
76-
// costAmount is of type NSNumber
77-
if (![self.costAmount isEqualToNumber:attribution.costAmount]) {
77+
if (![NSNumber adjIsEqual:self.costAmount toNumber:attribution.costAmount]) {
7878
return NO;
7979
}
8080
if (![NSString adjIsEqual:self.costCurrency toString:attribution.costCurrency]) {

0 commit comments

Comments
 (0)