Skip to content

Commit

Permalink
Merge pull request #239 from adjust/v4381
Browse files Browse the repository at this point in the history
Version 4.38.1
  • Loading branch information
uerceg authored Apr 30, 2024
2 parents 2b1b3c4 + 36fc62d commit 48ae1bb
Show file tree
Hide file tree
Showing 31 changed files with 632 additions and 483 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### Version 4.38.1 (30th April 2024)
#### Added
- Added sending of the additional iOS SDK observability parameters for debugging purposes.

#### Fixed
- Removed nullability type specifier warnings (https://github.com/adjust/ios_sdk/issues/703).

#### Native SDKs
- [[email protected]][ios_sdk_v4.38.2]
- [[email protected]][android_sdk_v4.38.3]

---

### Version 4.38.0 (27th March 2024)
#### Added
- Added iOS Privacy Manifest for the Adjust SDK.
Expand Down Expand Up @@ -645,6 +658,7 @@
[ios_sdk_v4.37.0]: https://github.com/adjust/ios_sdk/tree/v4.37.0
[ios_sdk_v4.37.2]: https://github.com/adjust/ios_sdk/tree/v4.37.2
[ios_sdk_v4.38.0]: https://github.com/adjust/ios_sdk/tree/v4.38.0
[ios_sdk_v4.38.2]: https://github.com/adjust/ios_sdk/tree/v4.38.2

[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.38.0
4.38.1
Binary file modified android/libs/adjust-android.jar
Binary file not shown.
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Adjust (4.38.0):
- Adjust/Core (= 4.38.0)
- Adjust/Core (4.38.0)
- Adjust (4.38.2):
- Adjust/Core (= 4.38.2)
- Adjust/Core (4.38.2)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
Expand Down Expand Up @@ -287,8 +287,8 @@ PODS:
- React-jsinspector (0.69.4)
- React-logger (0.69.4):
- glog
- react-native-adjust (4.38.0):
- Adjust (= 4.38.0)
- react-native-adjust (4.38.1):
- Adjust (= 4.38.2)
- React-Core
- React-perflogger (0.69.4)
- React-RCTActionSheet (0.69.4):
Expand Down Expand Up @@ -508,7 +508,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Adjust: c98d85594a746ff9f2bafe424c5beb6db66cd6a8
Adjust: 5a0f813fe079212bed61404d1f635cc330068b4a
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand Down Expand Up @@ -541,7 +541,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: a27badbbdbc0ff781813370736a2d1c7261181d4
React-jsinspector: 8a3d3f5dcd23a91e8c80b1bf0e96902cd1dca999
React-logger: 1088859f145b8f6dd0d3ed051a647ef0e3e80fad
react-native-adjust: 801fe33f0dc0097b0474f11d08572a89fa6602ce
react-native-adjust: 83114d391a4a7a438e2c4d8e8137bc7810e7076f
React-perflogger: cb386fd44c97ec7f8199c04c12b22066b0f2e1e0
React-RCTActionSheet: f803a85e46cf5b4066c2ac5e122447f918e9c6e5
React-RCTAnimation: 19c80fa950ccce7f4db76a2a7f2cf79baae07fc7
Expand Down
413 changes: 207 additions & 206 deletions example/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Adjust.getAmazonAdId = function(callback) {
};

Adjust.getSdkVersion = function(callback) {
module_adjust.getSdkVersion("react-native4.38.0", callback);
module_adjust.getSdkVersion("react-native4.38.1", callback);
};

Adjust.setReferrer = function(referrer) {
Expand Down Expand Up @@ -280,7 +280,7 @@ Adjust.onPause = function(testParam) {
// AdjustConfig

var AdjustConfig = function(appToken, environment) {
this.sdkPrefix = "react-native4.38.0";
this.sdkPrefix = "react-native4.38.1";
this.appToken = appToken;
this.environment = environment;
this.logLevel = null;
Expand Down
29 changes: 17 additions & 12 deletions ios/Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ - (void)sendAdServicesClickPackage:(ADJActivityHandler *)selfI
sessionParameters:self.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];
clickBuilder.internalState = selfI.internalState;

ADJActivityPackage *clickPackage =
[clickBuilder buildClickPackage:ADJAdServicesPackageKey
Expand Down Expand Up @@ -684,6 +685,7 @@ - (void)trackAttStatusUpdateI:(ADJActivityHandler *)selfI {
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];
infoBuilder.internalState = selfI.internalState;

ADJActivityPackage *infoPackage = [infoBuilder buildInfoPackage:@"att"];
[selfI.packageHandler addPackage:infoPackage];
Expand Down Expand Up @@ -1119,6 +1121,7 @@ - (void)transferSessionPackageI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];
sessionBuilder.internalState = selfI.internalState;
ADJActivityPackage *sessionPackage = [sessionBuilder buildSessionPackage:[selfI.internalState isInDelayedStart]];
[selfI.packageHandler addPackage:sessionPackage];
[selfI.packageHandler sendFirstPackage];
Expand Down Expand Up @@ -1194,6 +1197,7 @@ - (void)eventI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];
eventBuilder.internalState = selfI.internalState;
ADJActivityPackage *eventPackage = [eventBuilder buildEventPackage:event
isInDelay:[selfI.internalState isInDelayedStart]];
[selfI.packageHandler addPackage:eventPackage];
Expand Down Expand Up @@ -1235,7 +1239,7 @@ - (void)adRevenueI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

adRevenueBuilder.internalState = selfI.internalState;
ADJActivityPackage *adRevenuePackage = [adRevenueBuilder buildAdRevenuePackage:source payload:payload];
[selfI.packageHandler addPackage:adRevenuePackage];
if (selfI.adjustConfig.eventBufferingEnabled) {
Expand Down Expand Up @@ -1267,7 +1271,7 @@ - (void)trackSubscriptionI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

subscriptionBuilder.internalState = selfI.internalState;
ADJActivityPackage *subscriptionPackage = [subscriptionBuilder buildSubscriptionPackage:subscription
isInDelay:[selfI.internalState isInDelayedStart]];
[selfI.packageHandler addPackage:subscriptionPackage];
Expand Down Expand Up @@ -1316,7 +1320,7 @@ - (void)disableThirdPartySharingI:(ADJActivityHandler *)selfI {
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

dtpsBuilder.internalState = selfI.internalState;
ADJActivityPackage *dtpsPackage = [dtpsBuilder buildDisableThirdPartySharingPackage];

[selfI.packageHandler addPackage:dtpsPackage];
Expand Down Expand Up @@ -1357,7 +1361,7 @@ - (BOOL)trackThirdPartySharingI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

tpsBuilder.internalState = selfI.internalState;
ADJActivityPackage *dtpsPackage = [tpsBuilder buildThirdPartySharingPackage:thirdPartySharing];

[selfI.packageHandler addPackage:dtpsPackage];
Expand Down Expand Up @@ -1394,7 +1398,7 @@ - (BOOL)trackMeasurementConsentI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

tpsBuilder.internalState = selfI.internalState;
ADJActivityPackage *mcPackage = [tpsBuilder buildMeasurementConsentPackage:enabled];

[selfI.packageHandler addPackage:mcPackage];
Expand Down Expand Up @@ -1433,7 +1437,7 @@ - (void)trackAdRevenueI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

adRevenueBuilder.internalState = selfI.internalState;
ADJActivityPackage *adRevenuePackage = [adRevenueBuilder buildAdRevenuePackage:adRevenue
isInDelay:[selfI.internalState isInDelayedStart]];
[selfI.packageHandler addPackage:adRevenuePackage];
Expand Down Expand Up @@ -1500,7 +1504,7 @@ - (void)verifyPurchaseI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

purchaseVerificationBuilder.internalState = selfI.internalState;
ADJActivityPackage *purchaseVerificationPackage = [purchaseVerificationBuilder buildPurchaseVerificationPackage:purchase];
purchaseVerificationPackage.purchaseVerificationCallback = completionHandler;
[selfI.purchaseVerificationHandler sendPurchaseVerificationPackage:purchaseVerificationPackage];
Expand Down Expand Up @@ -1917,7 +1921,7 @@ - (void)appWillOpenUrlI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

clickBuilder.internalState = selfI.internalState;
clickBuilder.deeplinkParameters = [adjustDeepLinks copy];
clickBuilder.attribution = deeplinkAttribution;
clickBuilder.clickTime = clickTime;
Expand Down Expand Up @@ -2021,7 +2025,7 @@ - (void)setDeviceTokenI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

infoBuilder.internalState = selfI.internalState;
ADJActivityPackage *infoPackage = [infoBuilder buildInfoPackage:@"push"];

[selfI.packageHandler addPackage:infoPackage];
Expand Down Expand Up @@ -2070,7 +2074,7 @@ - (void)setPushTokenI:(ADJActivityHandler *)selfI
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

infoBuilder.internalState = selfI.internalState;
ADJActivityPackage *infoPackage = [infoBuilder buildInfoPackage:@"push"];
[selfI.packageHandler addPackage:infoPackage];

Expand Down Expand Up @@ -2111,7 +2115,7 @@ - (void)setGdprForgetMeI:(ADJActivityHandler *)selfI {
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

gdprBuilder.internalState = selfI.internalState;
ADJActivityPackage *gdprPackage = [gdprBuilder buildGdprPackage];
[selfI.packageHandler addPackage:gdprPackage];

Expand Down Expand Up @@ -2183,6 +2187,7 @@ - (void)checkLinkMeI:(ADJActivityHandler *)selfI {
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];
clickBuilder.internalState = selfI.internalState;
clickBuilder.clickTime = [NSDate dateWithTimeIntervalSince1970:now];
ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"linkme" linkMeUrl:pasteboardUrlString];
[selfI.sdkClickHandler sendSdkClick:clickPackage];
Expand Down Expand Up @@ -2940,7 +2945,7 @@ - (void)disableThirdPartySharingForCoppaEnabledI:(ADJActivityHandler *)selfI {
sessionParameters:selfI.sessionParameters
trackingStatusManager:self.trackingStatusManager
createdAt:now];

tpsBuilder.internalState = selfI.internalState;
ADJActivityPackage *dtpsPackage = [tpsBuilder buildThirdPartySharingPackage:thirdPartySharing];

[selfI.packageHandler addPackage:dtpsPackage];
Expand Down
10 changes: 10 additions & 0 deletions ios/Adjust/ADJActivityPackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@

@property (nonatomic, copy) void (^purchaseVerificationCallback)(id);

@property (nonatomic, assign) NSUInteger errorCount;

@property (nonatomic, copy) NSNumber *firstErrorCode;

@property (nonatomic, copy) NSNumber *lastErrorCode;

@property (nonatomic, assign) double waitBeforeSend;

- (void)addError:(NSNumber *)errorCode;

// Logs

@property (nonatomic, copy) NSString *suffix;
Expand Down
25 changes: 25 additions & 0 deletions ios/Adjust/ADJActivityPackage.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ - (NSString *)failureMessage {
return [NSString stringWithFormat:@"Failed to track %@%@", [ADJActivityKindUtil activityKindToString:self.activityKind], self.suffix];
}

- (void)addError:(NSNumber *)errorCode {
self.errorCount = self.errorCount + 1;

if (self.firstErrorCode == nil) {
self.firstErrorCode = errorCode;
} else {
self.lastErrorCode = errorCode;
}
}

#pragma mark - NSCoding protocol methods

- (id)initWithCoder:(NSCoder *)decoder {
Expand All @@ -79,6 +89,17 @@ - (id)initWithCoder:(NSCoder *)decoder {
NSString *kindString = [decoder decodeObjectForKey:@"kind"];
self.activityKind = [ADJActivityKindUtil activityKindFromString:kindString];

id errorCountObject = [decoder decodeObjectForKey:@"errorCount"];
if (errorCountObject != nil && [errorCountObject isKindOfClass:[NSNumber class]]) {
self.errorCount = ((NSNumber *)errorCountObject).unsignedIntegerValue;
}
self.firstErrorCode = [decoder decodeObjectForKey:@"firstErrorCode"];
self.lastErrorCode = [decoder decodeObjectForKey:@"lastErrorCode"];
id waitBeforeSendObject = [decoder decodeObjectForKey:@"waitBeforeSend"];
if (waitBeforeSendObject != nil && [waitBeforeSendObject isKindOfClass:[NSNumber class]]) {
self.waitBeforeSend = ((NSNumber *)waitBeforeSendObject).doubleValue;
}

return self;
}

Expand All @@ -92,6 +113,10 @@ - (void)encodeWithCoder:(NSCoder *)encoder {
[encoder encodeObject:self.parameters forKey:@"parameters"];
[encoder encodeObject:self.callbackParameters forKey:@"callbackParameters"];
[encoder encodeObject:self.partnerParameters forKey:@"partnerParameters"];
[encoder encodeObject:@(self.errorCount) forKey:@"errorCount"];
[encoder encodeObject:self.firstErrorCode forKey:@"firstErrorCode"];
[encoder encodeObject:self.lastErrorCode forKey:@"lastErrorCode"];
[encoder encodeObject:@(self.waitBeforeSend) forKey:@"waitBeforeSend"];
}

@end
10 changes: 10 additions & 0 deletions ios/Adjust/ADJPackageBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

@property (nonatomic, copy) ADJAttribution * _Nullable attribution;

@property (nonatomic, weak) ADJInternalState * _Nullable internalState;

- (id _Nullable)initWithPackageParams:(ADJPackageParams * _Nullable)packageParams
activityState:(ADJActivityState * _Nullable)activityState
config:(ADJConfig * _Nullable)adjustConfig
Expand Down Expand Up @@ -88,10 +90,18 @@
setInt:(int)value
forKey:(NSString * _Nullable)key;

+ (void)parameters:(NSMutableDictionary * _Nullable)parameters
setDouble:(double)value
forKey:(NSString * _Nullable)key;

+ (void)parameters:(NSMutableDictionary * _Nullable)parameters
setDate1970:(double)value
forKey:(NSString * _Nullable)key;

+ (void)parameters:(NSMutableDictionary * _Nullable)parameters
setNumberWithoutRounding:(NSNumber * _Nullable)value
forKey:(NSString * _Nullable)key;

+ (BOOL)isAdServicesPackage:(ADJActivityPackage * _Nullable)activityPackage;

+ (void)addConsentDataToParameters:(NSMutableDictionary * _Nullable)parameters
Expand Down
28 changes: 27 additions & 1 deletion ios/Adjust/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,26 @@ - (void)addIdfvIfPossibleToParameters:(NSMutableDictionary *)parameters {
}

- (void)injectFeatureFlagsWithParameters:(NSMutableDictionary *)parameters {
[ADJPackageBuilder parameters:parameters setBool:self.adjustConfig.eventBufferingEnabled
[ADJPackageBuilder parameters:parameters
setBool:self.adjustConfig.eventBufferingEnabled
forKey:@"event_buffering_enabled"];
[ADJPackageBuilder parameters:parameters
setBool:self.adjustConfig.sendInBackground
forKey:@"send_in_background_enabled"];
if (self.internalState != nil) {
[ADJPackageBuilder parameters:parameters
setBool:self.internalState.isOffline
forKey:@"offline_mode_enabled"];
if (self.internalState.isInForeground == YES) {
[ADJPackageBuilder parameters:parameters
setBool:YES
forKey:@"foreground"];
} else {
[ADJPackageBuilder parameters:parameters
setBool:YES
forKey:@"background"];
}
}
if (self.adjustConfig.coppaCompliantEnabled == YES) {
[ADJPackageBuilder parameters:parameters setBool:YES forKey:@"ff_coppa"];
}
Expand Down Expand Up @@ -1253,6 +1271,14 @@ + (void)parameters:(NSMutableDictionary *)parameters setInt:(int)value forKey:(N
[ADJPackageBuilder parameters:parameters setString:valueString forKey:key];
}

+ (void)parameters:(NSMutableDictionary *)parameters setDouble:(double)value forKey:(NSString *)key {
if (value <= 0.0) {
return;
}
NSString *valueString = [NSString stringWithFormat:@"%.2f", value];
[ADJPackageBuilder parameters:parameters setString:valueString forKey:key];
}

+ (void)parameters:(NSMutableDictionary *)parameters setDate1970:(double)value forKey:(NSString *)key {
if (value < 0) {
return;
Expand Down
Loading

0 comments on commit 48ae1bb

Please sign in to comment.