Skip to content

Commit

Permalink
Merge pull request #499 from adjust/v4260
Browse files Browse the repository at this point in the history
Version 4.26.0
  • Loading branch information
uerceg authored Feb 2, 2021
2 parents 936af17 + 4a366f2 commit 85f6a71
Show file tree
Hide file tree
Showing 44 changed files with 212 additions and 159 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.25.2"
s.version = "4.26.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.25.2" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.26.0" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
2 changes: 1 addition & 1 deletion Adjust.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@
9679920518BBAE2800394606 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1220;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "adjust GmbH";
TargetAttributes = {
9615158E1CD2CB2C0022D336 = {
Expand Down
2 changes: 1 addition & 1 deletion Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
115 changes: 59 additions & 56 deletions Adjust/ADJActivityHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@property (nonatomic, assign) BOOL firstLaunch;
@property (nonatomic, assign) BOOL sessionResponseProcessed;

- (id)init;
- (_Nullable id)init;

- (BOOL)isEnabled;
- (BOOL)isDisabled;
Expand All @@ -41,108 +41,111 @@

@interface ADJSavedPreLaunch : NSObject

@property (nonatomic, strong) NSMutableArray *preLaunchActionsArray;
@property (nonatomic, copy) NSData *deviceTokenData;
@property (nonatomic, copy) NSNumber *enabled;
@property (nonatomic, strong) NSMutableArray * _Nullable preLaunchActionsArray;
@property (nonatomic, copy) NSData *_Nullable deviceTokenData;
@property (nonatomic, copy) NSNumber *_Nullable enabled;
@property (nonatomic, assign) BOOL offline;
@property (nonatomic, copy) NSString *extraPath;
@property (nonatomic, strong) NSMutableArray *preLaunchAdjustThirdPartySharingArray;
@property (nonatomic, copy) NSNumber *lastMeasurementConsentTracked;
@property (nonatomic, copy) NSString *_Nullable extraPath;
@property (nonatomic, strong) NSMutableArray *_Nullable preLaunchAdjustThirdPartySharingArray;
@property (nonatomic, copy) NSNumber *_Nullable lastMeasurementConsentTracked;

- (id)init;
- (id _Nullable)init;

@end

@class ADJTrackingStatusManager;

@protocol ADJActivityHandler <NSObject>

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

- (NSString *)adid;
- (NSString *_Nullable)adid;

- (id)initWithConfig:(ADJConfig *)adjustConfig
savedPreLaunch:(ADJSavedPreLaunch *)savedPreLaunch;
- (id _Nullable)initWithConfig:(ADJConfig *_Nullable)adjustConfig
savedPreLaunch:(ADJSavedPreLaunch * _Nullable)savedPreLaunch;

- (void)applicationDidBecomeActive;
- (void)applicationWillResignActive;

- (void)trackEvent:(ADJEvent *)event;
- (void)trackEvent:(ADJEvent * _Nullable)event;

- (void)finishedTracking:(ADJResponseData *)responseData;
- (void)launchEventResponseTasks:(ADJEventResponseData *)eventResponseData;
- (void)launchSessionResponseTasks:(ADJSessionResponseData *)sessionResponseData;
- (void)launchSdkClickResponseTasks:(ADJSdkClickResponseData *)sdkClickResponseData;
- (void)launchAttributionResponseTasks:(ADJAttributionResponseData *)attributionResponseData;
- (void)finishedTracking:(ADJResponseData * _Nullable)responseData;
- (void)launchEventResponseTasks:(ADJEventResponseData * _Nullable)eventResponseData;
- (void)launchSessionResponseTasks:(ADJSessionResponseData * _Nullable)sessionResponseData;
- (void)launchSdkClickResponseTasks:(ADJSdkClickResponseData * _Nullable)sdkClickResponseData;
- (void)launchAttributionResponseTasks:(ADJAttributionResponseData * _Nullable)attributionResponseData;
- (void)setEnabled:(BOOL)enabled;
- (BOOL)isEnabled;
- (BOOL)isGdprForgotten;

- (void)appWillOpenUrl:(NSURL*)url withClickTime:(NSDate *)clickTime;
- (void)setDeviceToken:(NSData *)deviceToken;
- (void)setPushToken:(NSString *)deviceToken;
- (void)appWillOpenUrl:(NSURL * _Nullable)url
withClickTime:(NSDate * _Nullable)clickTime;
- (void)setDeviceToken:(NSData * _Nullable)deviceToken;
- (void)setPushToken:(NSString * _Nullable)deviceToken;
- (void)setGdprForgetMe;
- (void)setTrackingStateOptedOut;
- (void)setAskingAttribution:(BOOL)askingAttribution;

- (BOOL)updateAttributionI:(id<ADJActivityHandler>)selfI attribution:(ADJAttribution *)attribution;
- (void)setAttributionDetails:(NSDictionary *)attributionDetails
error:(NSError *)error;
- (void)setAdServicesAttributionToken:(NSString *)token
error:(NSError *)error;
- (BOOL)updateAttributionI:(id<ADJActivityHandler> _Nullable)selfI
attribution:(ADJAttribution * _Nullable)attribution;
- (void)setAttributionDetails:(NSDictionary * _Nullable)attributionDetails
error:(NSError * _Nullable)error;
- (void)setAdServicesAttributionToken:(NSString * _Nullable)token
error:(NSError * _Nullable)error;

- (void)setOfflineMode:(BOOL)offline;
- (void)sendFirstPackages;

- (void)addSessionCallbackParameter:(NSString *)key
value:(NSString *)value;
- (void)addSessionPartnerParameter:(NSString *)key
value:(NSString *)value;
- (void)removeSessionCallbackParameter:(NSString *)key;
- (void)removeSessionPartnerParameter:(NSString *)key;
- (void)addSessionCallbackParameter:(NSString * _Nullable)key
value:(NSString * _Nullable)value;
- (void)addSessionPartnerParameter:(NSString * _Nullable)key
value:(NSString * _Nullable)value;
- (void)removeSessionCallbackParameter:(NSString * _Nullable)key;
- (void)removeSessionPartnerParameter:(NSString * _Nullable)key;
- (void)resetSessionCallbackParameters;
- (void)resetSessionPartnerParameters;
- (void)trackAdRevenue:(NSString *)soruce payload:(NSData *)payload;
- (void)trackAdRevenue:(NSString * _Nullable)soruce
payload:(NSData * _Nullable)payload;
- (void)disableThirdPartySharing;
- (void)trackThirdPartySharing:(nonnull ADJThirdPartySharing *)thirdPartySharing;
- (void)trackMeasurementConsent:(BOOL)enabled;
- (void)trackSubscription:(ADJSubscription *)subscription;
- (void)trackSubscription:(ADJSubscription * _Nullable)subscription;
- (void)updateAttStatusFromUserCallback:(int)newAttStatusFromUser;

- (ADJDeviceInfo *)deviceInfo;
- (ADJActivityState *)activityState;
- (ADJConfig *)adjustConfig;
- (ADJSessionParameters *)sessionParameters;
- (ADJDeviceInfo * _Nullable)deviceInfo;
- (ADJActivityState * _Nullable)activityState;
- (ADJConfig * _Nullable)adjustConfig;
- (ADJSessionParameters * _Nullable)sessionParameters;

- (void)teardown;
+ (void)deleteState;
@end

@interface ADJActivityHandler : NSObject <ADJActivityHandler>

- (id)initWithConfig:(ADJConfig *)adjustConfig
savedPreLaunch:(ADJSavedPreLaunch *)savedPreLaunch;
- (id _Nullable)initWithConfig:(ADJConfig * _Nullable)adjustConfig
savedPreLaunch:(ADJSavedPreLaunch * _Nullable)savedPreLaunch;

- (void)addSessionCallbackParameterI:(ADJActivityHandler *)selfI
key:(NSString *)key
value:(NSString *)value;
- (void)addSessionCallbackParameterI:(ADJActivityHandler * _Nullable)selfI
key:(NSString * _Nullable)key
value:(NSString * _Nullable)value;

- (void)addSessionPartnerParameterI:(ADJActivityHandler *)selfI
key:(NSString *)key
value:(NSString *)value;
- (void)removeSessionCallbackParameterI:(ADJActivityHandler *)selfI
key:(NSString *)key;
- (void)removeSessionPartnerParameterI:(ADJActivityHandler *)selfI
key:(NSString *)key;
- (void)resetSessionCallbackParametersI:(ADJActivityHandler *)selfI;
- (void)resetSessionPartnerParametersI:(ADJActivityHandler *)selfI;
- (void)addSessionPartnerParameterI:(ADJActivityHandler * _Nullable)selfI
key:(NSString * _Nullable)key
value:(NSString * _Nullable)value;
- (void)removeSessionCallbackParameterI:(ADJActivityHandler * _Nullable)selfI
key:(NSString * _Nullable)key;
- (void)removeSessionPartnerParameterI:(ADJActivityHandler * _Nullable)selfI
key:(NSString * _Nullable)key;
- (void)resetSessionCallbackParametersI:(ADJActivityHandler * _Nullable)selfI;
- (void)resetSessionPartnerParametersI:(ADJActivityHandler * _Nullable)selfI;

@end

@interface ADJTrackingStatusManager : NSObject

- (instancetype)initWithActivityHandler:(ADJActivityHandler *)activityHandler;
- (instancetype _Nullable)initWithActivityHandler:(ADJActivityHandler * _Nullable)activityHandler;

- (void)checkForNewAttStatus;
- (void)updateAttStatusFromUserCallback:(int)newAttStatusFromUser;
Expand All @@ -154,5 +157,5 @@

@end

extern NSString * const ADJiAdPackageKey;
extern NSString * const ADJAdServicesPackageKey;
extern NSString * _Nullable const ADJiAdPackageKey;
extern NSString * _Nullable const ADJAdServicesPackageKey;
23 changes: 1 addition & 22 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -2708,29 +2708,8 @@ - (void)checkConversionValue:(ADJResponseData *)responseData {
if (!conversionValue) {
return;
}

id<ADJLogger> logger = [ADJAdjustFactory logger];

Class skAdNetwork = NSClassFromString(@"SKAdNetwork");
if (skAdNetwork == nil) {
[logger warn:@"StoreKit framework not found in user's app (SKAdNetwork not found)"];
return;
}

SEL updateConversionValueSelector = NSSelectorFromString(@"updateConversionValue:");
if ([skAdNetwork respondsToSelector:updateConversionValueSelector]) {
NSInteger intValue = [conversionValue integerValue];

NSMethodSignature *conversionValueMethodSignature = [skAdNetwork methodSignatureForSelector:updateConversionValueSelector];
NSInvocation *conversionInvocation = [NSInvocation invocationWithMethodSignature:conversionValueMethodSignature];
[conversionInvocation setSelector:updateConversionValueSelector];
[conversionInvocation setTarget:skAdNetwork];

[conversionInvocation setArgument:&intValue atIndex:2];
[conversionInvocation invoke];

[logger verbose:@"Call to SKAdNetwork's updateConversionValue: method made with value %d", intValue];
}
[ADJUtil updateSkAdNetworkConversionValue:conversionValue];
}

- (void)updateAttStatusFromUserCallback:(int)newAttStatusFromUser {
Expand Down
78 changes: 39 additions & 39 deletions Adjust/ADJPackageBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,71 +18,71 @@

@interface ADJPackageBuilder : NSObject

@property (nonatomic, copy) NSString *deeplink;
@property (nonatomic, copy) NSString * _Nullable deeplink;

@property (nonatomic, copy) NSDate *clickTime;
@property (nonatomic, copy) NSDate * _Nullable clickTime;

@property (nonatomic, copy) NSDate *purchaseTime;
@property (nonatomic, copy) NSDate * _Nullable purchaseTime;

@property (nonatomic, strong) NSDictionary *attributionDetails;
@property (nonatomic, strong) NSDictionary * _Nullable attributionDetails;

@property (nonatomic, strong) NSDictionary *deeplinkParameters;
@property (nonatomic, strong) NSDictionary * _Nullable deeplinkParameters;

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

- (id)initWithDeviceInfo:(ADJDeviceInfo *)deviceInfo
activityState:(ADJActivityState *)activityState
config:(ADJConfig *)adjustConfig
sessionParameters:(ADJSessionParameters *)sessionParameters
trackingStatusManager:(ADJTrackingStatusManager *)trackingStatusManager
createdAt:(double)createdAt;
- (id _Nullable)initWithDeviceInfo:(ADJDeviceInfo * _Nullable)deviceInfo
activityState:(ADJActivityState * _Nullable)activityState
config:(ADJConfig * _Nullable)adjustConfig
sessionParameters:(ADJSessionParameters * _Nullable)sessionParameters
trackingStatusManager:(ADJTrackingStatusManager * _Nullable)trackingStatusManager
createdAt:(double)createdAt;

- (ADJActivityPackage *)buildSessionPackage:(BOOL)isInDelay;
- (ADJActivityPackage * _Nullable)buildSessionPackage:(BOOL)isInDelay;

- (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event
- (ADJActivityPackage * _Nullable)buildEventPackage:(ADJEvent * _Nullable)event
isInDelay:(BOOL)isInDelay;

- (ADJActivityPackage *)buildInfoPackage:(NSString *)infoSource;
- (ADJActivityPackage * _Nullable)buildInfoPackage:(NSString * _Nullable)infoSource;

- (ADJActivityPackage *)buildAdRevenuePackage:(NSString *)source payload:(NSData *)payload;
- (ADJActivityPackage * _Nullable)buildAdRevenuePackage:(NSString * _Nullable)source payload:(NSData * _Nullable)payload;

- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource;
- (ADJActivityPackage * _Nullable)buildClickPackage:(NSString * _Nullable)clickSource;

- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource
token:(NSString *)token
errorCodeNumber:(NSNumber *)errorCodeNumber;
- (ADJActivityPackage * _Nullable)buildClickPackage:(NSString * _Nullable)clickSource
token:(NSString * _Nullable)token
errorCodeNumber:(NSNumber * _Nullable)errorCodeNumber;

- (ADJActivityPackage *)buildAttributionPackage:(NSString *)initiatedBy;
- (ADJActivityPackage * _Nullable)buildAttributionPackage:(NSString * _Nullable)initiatedBy;

- (ADJActivityPackage *)buildGdprPackage;
- (ADJActivityPackage * _Nullable)buildGdprPackage;

- (ADJActivityPackage *)buildDisableThirdPartySharingPackage;
- (ADJActivityPackage * _Nullable)buildDisableThirdPartySharingPackage;

- (ADJActivityPackage *)buildThirdPartySharingPackage:(nonnull ADJThirdPartySharing *)thirdPartySharing;
- (ADJActivityPackage * _Nullable)buildThirdPartySharingPackage:(nonnull ADJThirdPartySharing *)thirdPartySharing;

- (ADJActivityPackage *)buildMeasurementConsentPackage:(BOOL)enabled;
- (ADJActivityPackage * _Nullable)buildMeasurementConsentPackage:(BOOL)enabled;

- (ADJActivityPackage *)buildSubscriptionPackage:(ADJSubscription *)subscription
isInDelay:(BOOL)isInDelay;
- (ADJActivityPackage * _Nullable)buildSubscriptionPackage:( ADJSubscription * _Nullable)subscription
isInDelay:(BOOL)isInDelay;

+ (void)parameters:(NSMutableDictionary *)parameters
setDictionary:(NSDictionary *)dictionary
forKey:(NSString *)key;
+ (void)parameters:(NSMutableDictionary * _Nullable)parameters
setDictionary:(NSDictionary * _Nullable)dictionary
forKey:(NSString * _Nullable)key;

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

+ (void)parameters:(NSMutableDictionary *)parameters
+ (void)parameters:(NSMutableDictionary * _Nullable)parameters
setInt:(int)value
forKey:(NSString *)key;
forKey:(NSString * _Nullable)key;

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

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

@end
// TODO change to ADJ...
extern NSString * const ADJAttributionTokenParameter;
extern NSString * _Nullable const ADJAttributionTokenParameter;
2 changes: 2 additions & 0 deletions Adjust/ADJUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,6 @@ typedef void (^isInactiveInjected)(BOOL);
+ (NSString *)enforceParameterLength:(NSString *)parameter
withMaxlength:(NSUInteger)maxLength;

+ (void)updateSkAdNetworkConversionValue:(NSNumber *)conversionValue;

@end
Loading

0 comments on commit 85f6a71

Please sign in to comment.