Skip to content

Commit

Permalink
build: restructures Adjust project
Browse files Browse the repository at this point in the history
  • Loading branch information
genadyb authored and uerceg committed Aug 2, 2024
1 parent e49b5b9 commit 192765f
Show file tree
Hide file tree
Showing 143 changed files with 1,692 additions and 4,215 deletions.
17 changes: 9 additions & 8 deletions Adjust.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ Pod::Spec.new do |s|
s.ios.weak_framework = 'AdSupport'
s.tvos.weak_framework = 'AdSupport'
s.default_subspec = 'Adjust'

s.subspec 'Core' do |co|
co.source_files = 'Adjust/**/*.{h,m}'
co.resource_bundle = {'Adjust' => ['Adjust/*.xcprivacy']}
end
s.module_map = 'ModuleMap/module.modulemap'

s.subspec 'Adjust' do |ads|
ads.dependency 'Adjust/Core'
ads.source_files = 'Adjust/**/*.{h,m}'
ads.public_header_files = 'Adjust/*.h', 'UmbrellaHeaders/sdk/*.h'
ads.resource_bundle = {'Adjust' => ['Adjust/*.xcprivacy']}
ads.header_dir = 'AdjustSdk'
ads.dependency 'AdjustSignature', '3.18'
end

s.subspec 'AdjustWebBridge' do |wb|
wb.dependency 'Adjust/Core'
wb.source_files = 'Adjust/**/*.{h,m}', 'AdjustBridge/*.{h,m}', 'UmbrellaHeaders/webbridge/*.{h,m}'
wb.public_header_files = 'Adjust/*.h', 'AdjustBridge/*.h', 'UmbrellaHeaders/webbridge/*.h'
wb.resource_bundle = {'Adjust' => ['Adjust/*.xcprivacy']}
wb.header_dir = 'AdjustSdk'
wb.dependency 'AdjustSignature', '3.18'
wb.source_files = 'AdjustBridge/*.{h,m}', 'AdjustBridge/WebViewJavascriptBridge/*.{h,m}'
wb.ios.deployment_target = '12.0'
end
end
2,651 changes: 1,034 additions & 1,617 deletions Adjust.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions Adjust/ADJConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

#import <Foundation/Foundation.h>

#import "ADJLogger.h"
#import "ADJAttribution.h"
#import "ADJEventSuccess.h"
#import "ADJEventFailure.h"
#import "ADJSessionSuccess.h"
#import "ADJSessionFailure.h"
@class ADJLogger;
@class ADJAttribution;
@class ADJEventSuccess;
@class ADJEventFailure;
@class ADJSessionSuccess;
@class ADJSessionFailure;
typedef NS_ENUM(NSUInteger, ADJLogLevel);

#pragma mark - AdjustDelegate methods

Expand Down
1 change: 0 additions & 1 deletion Adjust/ADJConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "ADJAdjustFactory.h"
#import "ADJLogger.h"
#import "ADJUtil.h"
#import "Adjust.h"

@interface ADJConfig()

Expand Down
4 changes: 2 additions & 2 deletions Adjust/ADJLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
//
#import <Foundation/Foundation.h>

typedef enum {
typedef NS_ENUM(NSUInteger, ADJLogLevel) {
ADJLogLevelVerbose = 1,
ADJLogLevelDebug = 2,
ADJLogLevelInfo = 3,
ADJLogLevelWarn = 4,
ADJLogLevelError = 5,
ADJLogLevelAssert = 6,
ADJLogLevelSuppress = 7
} ADJLogLevel;
};

/**
* @brief Adjust logger protocol.
Expand Down
20 changes: 11 additions & 9 deletions Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved.
//

#import "ADJEvent.h"
#import "ADJConfig.h"
#import "ADJAttribution.h"
#import "ADJAppStoreSubscription.h"
#import "ADJThirdPartySharing.h"
#import "ADJAdRevenue.h"
#import "ADJLinkResolution.h"
#import "ADJAppStorePurchase.h"
#import "ADJPurchaseVerificationResult.h"
#import <Foundation/Foundation.h>

@class ADJEvent;
@class ADJConfig;
@class ADJAttribution;
@class ADJAppStoreSubscription;
@class ADJThirdPartySharing;
@class ADJAdRevenue;
@class ADJLinkResolution;
@class ADJAppStorePurchase;
@class ADJPurchaseVerificationResult;

typedef void(^ADJResolvedDeeplinkBlock)(NSString * _Nullable resolvedLink);
typedef void(^ADJAttributionGetterBlock)(ADJAttribution * _Nullable attribution);
Expand Down
1 change: 1 addition & 0 deletions Adjust/Adjust.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "ADJAdjustFactory.h"
#import "ADJActivityHandler.h"
#import "ADJSKAdNetwork.h"
#import "ADJPurchaseVerificationResult.h"

#if !__has_feature(objc_arc)
#error Adjust requires ARC
Expand Down
2 changes: 2 additions & 0 deletions Adjust/Internal/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#import "ADJUrlStrategy.h"
#import "ADJSKAdNetwork.h"
#import "ADJPurchaseVerificationHandler.h"
#import "ADJPurchaseVerificationResult.h"
#import "ADJAdRevenue.h"

NSString * const ADJAdServicesPackageKey = @"apple_ads";

Expand Down
2 changes: 1 addition & 1 deletion Adjust/Internal/ADJPackageBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
// Created by Christian Wellenbrock (@wellle) on 3rd July 2013.
// Copyright (c) 2013-2018 Adjust GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>

#import "ADJEvent.h"
#import "ADJConfig.h"
#import "ADJPackageParams.h"
#import "ADJActivityState.h"
#import "ADJActivityPackage.h"
#import "ADJGlobalParameters.h"
#import <Foundation/Foundation.h>
#import "ADJActivityHandler.h"
#import "ADJThirdPartySharing.h"

Expand Down
3 changes: 3 additions & 0 deletions Adjust/Internal/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#import "ADJActivityPackage.h"
#import "ADJAdditions.h"
#import "ADJUserDefaults.h"
#import "ADJAdRevenue.h"
#import "ADJAppStorePurchase.h"
#import "ADJAppStoreSubscription.h"

NSString * const ADJAttributionTokenParameter = @"attribution_token";

Expand Down
1 change: 1 addition & 0 deletions Adjust/Internal/ADJPurchaseVerificationHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "ADJBackoffStrategy.h"
#import "ADJUserDefaults.h"
#import "ADJPackageBuilder.h"
#import "ADJPurchaseVerificationResult.h"

static const char * const kInternalQueueName = "com.adjust.PurchaseVerificationQueue";

Expand Down
1 change: 0 additions & 1 deletion Adjust/Internal/ADJUrlStrategy.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import "ADJUrlStrategy.h"
#import "Adjust.h"
#import "ADJAdjustFactory.h"

static NSString * const kBaseAnalyticsUrl = @"https://analytics.adjust.com";
Expand Down
4 changes: 0 additions & 4 deletions Adjust/Internal/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
#import "ADJAdjustFactory.h"
#import "ADJAdditions.h"

#if !ADJUST_NO_IDFA
#import <AdSupport/ASIdentifierManager.h>
#endif

static NSRegularExpression *universalLinkRegex = nil;
static NSNumberFormatter *secondsNumberFormatter = nil;
static NSRegularExpression *optionalRedirectRegex = nil;
Expand Down
1 change: 0 additions & 1 deletion Adjust/include/ADJAdRevenue.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJAppStorePurchase.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJAppStoreSubscription.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJAttribution.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJConfig.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJEvent.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJEventFailure.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJEventSuccess.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJLinkResolution.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJLogger.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJPurchaseVerificationResult.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJSessionFailure.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJSessionSuccess.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/ADJThirdPartySharing.h

This file was deleted.

1 change: 0 additions & 1 deletion Adjust/include/Adjust.h

This file was deleted.

1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJAdRevenue.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJAppStorePurchase.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJAppStoreSubscription.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJAttribution.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJConfig.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJEvent.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJEventFailure.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJEventSuccess.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJLinkResolution.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJLogger.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJPurchaseVerificationResult.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJSessionFailure.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJSessionSuccess.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/ADJThirdPartySharing.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/Adjust.h
1 change: 1 addition & 0 deletions Adjust/include/AdjustSdk/AdjustSdk.h
5 changes: 3 additions & 2 deletions AdjustBridge/AdjustBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
// Copyright © 2016-2018 Adjust GmbH. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#import <Foundation/Foundation.h>
#import "AdjustBridgeRegister.h"

@class AdjustBridgeRegister;

@interface AdjustBridge : NSObject

Expand Down
14 changes: 8 additions & 6 deletions AdjustBridge/AdjustBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright © 2016-2018 Adjust GmbH. All rights reserved.
//

#import "Adjust.h"
#import "AdjustBridge.h"
#import "ADJAdjustFactory.h"
#import <AdjustSdk/AdjustSdk.h>
#import "AdjustBridgeRegister.h"
#import "WKWebViewJavascriptBridge.h"

@interface AdjustBridge() <AdjustDelegate>
Expand All @@ -25,6 +25,7 @@ @interface AdjustBridge() <AdjustDelegate>
@property (nonatomic, strong) NSMutableDictionary *fbPixelMapping;
@property (nonatomic, strong) NSMutableArray *urlStrategyDomains;
@property (nonatomic, strong) ADJAttribution *attribution;
@property (nonatomic, strong) ADJLogger *logger;

@end

Expand All @@ -40,6 +41,7 @@ - (id)init {

_bridgeRegister = nil;
self.isDeferredDeeplinkOpeningEnabled = YES;
_logger = [[ADJLogger alloc] init];

[self resetAdjustBridge];

Expand Down Expand Up @@ -174,7 +176,7 @@ - (void)augmentHybridWebView {
NSString *fbAppId = [self getFbAppId];

if (fbAppId == nil) {
[[ADJAdjustFactory logger] error:@"FacebookAppID is not correctly configured in the pList"];
[self.logger error:@"FacebookAppID is not correctly configured in the pList"];
return;
}
[_bridgeRegister augmentHybridWebView:fbAppId];
Expand Down Expand Up @@ -674,17 +676,17 @@ - (void)registerAugmentedView {
[self.bridgeRegister registerHandler:@"adjust_fbPixelEvent" handler:^(id data, WVJBResponseCallback responseCallback) {
NSString *pixelID = [data objectForKey:@"pixelID"];
if (pixelID == nil) {
[[ADJAdjustFactory logger] error:@"Can't bridge an event without a referral Pixel ID. Check your webview Pixel configuration"];
[self.logger error:@"Can't bridge an event without a referral Pixel ID. Check your webview Pixel configuration"];
return;
}
NSString *evtName = [data objectForKey:@"evtName"];
NSString *eventToken = [self getEventTokenFromFbPixelEventName:evtName];
if (eventToken == nil) {
[[ADJAdjustFactory logger] debug:@"No mapping found for the fb pixel event %@, trying to fall back to the default event token", evtName];
[self.logger debug:@"No mapping found for the fb pixel event %@, trying to fall back to the default event token", evtName];
eventToken = self.fbPixelDefaultEventToken;
}
if (eventToken == nil) {
[[ADJAdjustFactory logger] debug:@"There is not a default event token configured or a mapping found for event named: '%@'. It won't be tracked as an adjust event", evtName];
[self.logger debug:@"There is not a default event token configured or a mapping found for event named: '%@'. It won't be tracked as an adjust event", evtName];
return;
}

Expand Down
3 changes: 2 additions & 1 deletion AdjustBridge/AdjustBridgeRegister.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
//

#import <Foundation/Foundation.h>
#import "WKWebViewJavascriptBridge.h"
#import <WebKit/WebKit.h>
#import "WebViewJavascriptBridgeBase.h"

@interface AdjustBridgeRegister : NSObject

Expand Down
1 change: 1 addition & 0 deletions AdjustBridge/AdjustBridgeRegister.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "AdjustBridgeRegister.h"
#import "WKWebViewJavascriptBridge.h"

static NSString * const kHandlerPrefix = @"adjust_";
static NSString * fbAppIdStatic = nil;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import <Foundation/Foundation.h>
#import "WebViewJavascriptBridgeBase.h"
#import "WebViewJavascriptBridge_JS.h"
//#import "AdjustBridge_JS.h"
#import "AdjustBridgeRegister.h"

@implementation WebViewJavascriptBridgeBase {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#import "WebViewJavascriptBridge_JS.h"

NSString * WebViewJavascriptBridge_js() {
NSString * WebViewJavascriptBridge_js(void) {
#define __wvjb_js_func__(x) #x

// BEGIN preprocessorJSCode
Expand Down
1 change: 0 additions & 1 deletion AdjustBridge/include/AdjustBridge.h

This file was deleted.

1 change: 0 additions & 1 deletion AdjustBridge/include/AdjustBridgeRegister.h

This file was deleted.

1 change: 1 addition & 0 deletions AdjustBridge/include/AdjustWebBridge/AdjustBridge.h
1 change: 0 additions & 1 deletion AdjustBridge/include/WKWebViewJavascriptBridge.h

This file was deleted.

1 change: 0 additions & 1 deletion AdjustBridge/include/WebViewJavascriptBridgeBase.h

This file was deleted.

Loading

0 comments on commit 192765f

Please sign in to comment.