Skip to content

Commit 2007ce9

Browse files
authored
Merge pull request #101 from adjust/v4330
Version 4.33.0
2 parents 4e93eba + 96b082c commit 2007ce9

File tree

15 files changed

+126
-10
lines changed

15 files changed

+126
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### Version 4.33.0 (9th December 2022)
2+
#### Added
3+
- Added support for SKAD 4.0.
4+
- Added support for setting a new China URL Strategy. You can choose this setting by setting `urlStrategy` member of `AdjustConfig` instance to `AdjustConfig.UrlStrategyCn` value.
5+
6+
#### Native SDKs
7+
- [[email protected]][ios_sdk_v4.33.2]
8+
- [[email protected]][android_sdk_v4.32.2]
9+
10+
---
11+
112
### Version 4.32.0 (7th October 2022)
213
#### Added
314
- Added partner sharing settings to the third party sharing feature.
@@ -301,6 +312,7 @@
301312
[ios_sdk_v4.30.0]: https://github.com/adjust/ios_sdk/tree/v4.30.0
302313
[ios_sdk_v4.31.0]: https://github.com/adjust/ios_sdk/tree/v4.31.0
303314
[ios_sdk_v4.32.1]: https://github.com/adjust/ios_sdk/tree/v4.32.1
315+
[ios_sdk_v4.33.2]: https://github.com/adjust/ios_sdk/tree/v4.33.2
304316

305317
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
306318
[android_sdk_v4.18.0]: https://github.com/adjust/android_sdk/tree/v4.18.0
@@ -315,3 +327,4 @@
315327
[android_sdk_v4.30.1]: https://github.com/adjust/android_sdk/tree/v4.30.1
316328
[android_sdk_v4.31.0]: https://github.com/adjust/android_sdk/tree/v4.31.0
317329
[android_sdk_v4.32.0]: https://github.com/adjust/android_sdk/tree/v4.32.0
330+
[android_sdk_v4.33.2]: https://github.com/adjust/android_sdk/tree/v4.33.2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ You can add Adjust SDK to your Flutter app by adding following to your `pubspec.
104104

105105
```yaml
106106
dependencies:
107-
adjust_sdk: ^4.32.0
107+
adjust_sdk: ^4.33.0
108108
```
109109
110110
Then navigate to your project in the terminal and run:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.32.0
1+
4.33.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ android {
3636
}
3737

3838
dependencies {
39-
api 'com.adjust.sdk:adjust-android:4.32.0'
39+
api 'com.adjust.sdk:adjust-android:4.33.2'
4040
}

android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ private void start(final MethodCall call, final Result result) {
335335
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CHINA);
336336
} else if (urlStrategy.equalsIgnoreCase("india")) {
337337
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_INDIA);
338+
} else if (urlStrategy.equalsIgnoreCase("cn")) {
339+
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CN);
338340
} else if (urlStrategy.equalsIgnoreCase("data-residency-eu")) {
339341
adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_EU);
340342
} else if (urlStrategy.equalsIgnoreCase("data-residency-tr")) {

example/lib/main.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
235235
conversionValue!.toString());
236236
};
237237

238+
config.skad4ConversionValueUpdatedCallback = (num? conversionValue, String? coarseValue, bool? lockWindow) {
239+
print('[Adjust]: Received conversion value update!');
240+
print('[Adjust]: Conversion value: ' + conversionValue!.toString());
241+
print('[Adjust]: Coarse value: ' + coarseValue!);
242+
print('[Adjust]: Lock window: ' + lockWindow!.toString());
243+
};
244+
238245
// Add session callback parameters.
239246
Adjust.addSessionCallbackParameter('scp_foo_1', 'scp_bar');
240247
Adjust.addSessionCallbackParameter('scp_foo_2', 'scp_value');

ios/Classes/AdjustSdk.m

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
123123
[Adjust checkForNewAttStatus];
124124
} else if ([@"getLastDeeplink" isEqualToString:call.method]) {
125125
[self getLastDeeplink:call withResult:result];
126+
} else if ([@"updateConversionValueWithErrorCallback" isEqualToString:call.method]) {
127+
[self updateConversionValueWithErrorCallback:call withResult:result];
128+
} else if ([@"updateConversionValueWithErrorCallbackSkad4" isEqualToString:call.method]) {
129+
[self updateConversionValueWithErrorCallbackSkad4:call withResult:result];
126130
} else {
127131
result(FlutterMethodNotImplemented);
128132
}
@@ -160,6 +164,7 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
160164
NSString *dartEventFailureCallback = call.arguments[@"eventFailureCallback"];
161165
NSString *dartDeferredDeeplinkCallback = call.arguments[@"deferredDeeplinkCallback"];
162166
NSString *dartConversionValueUpdatedCallback = call.arguments[@"conversionValueUpdatedCallback"];
167+
NSString *dartSkad4ConversionValueUpdatedCallback = call.arguments[@"skad4ConversionValueUpdatedCallback"];
163168
BOOL allowSuppressLogLevel = NO;
164169
BOOL launchDeferredDeeplink = [call.arguments[@"launchDeferredDeeplink"] boolValue];
165170

@@ -221,6 +226,8 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
221226
[adjustConfig setUrlStrategy:ADJUrlStrategyChina];
222227
} else if ([urlStrategy isEqualToString:@"india"]) {
223228
[adjustConfig setUrlStrategy:ADJUrlStrategyIndia];
229+
} else if ([urlStrategy isEqualToString:@"cn"]) {
230+
[adjustConfig setUrlStrategy:ADJUrlStrategyCn];
224231
} else if ([urlStrategy isEqualToString:@"data-residency-eu"]) {
225232
[adjustConfig setUrlStrategy:ADJDataResidencyEU];
226233
} else if ([urlStrategy isEqualToString:@"data-residency-tr"]) {
@@ -292,7 +299,8 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
292299
|| dartEventSuccessCallback != nil
293300
|| dartEventFailureCallback != nil
294301
|| dartDeferredDeeplinkCallback != nil
295-
|| dartConversionValueUpdatedCallback != nil) {
302+
|| dartConversionValueUpdatedCallback != nil
303+
|| dartSkad4ConversionValueUpdatedCallback != nil) {
296304
[adjustConfig setDelegate:
297305
[AdjustSdkDelegate getInstanceWithSwizzleOfAttributionCallback:dartAttributionCallback
298306
sessionSuccessCallback:dartSessionSuccessCallback
@@ -301,6 +309,7 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
301309
eventFailureCallback:dartEventFailureCallback
302310
deferredDeeplinkCallback:dartDeferredDeeplinkCallback
303311
conversionValueUpdatedCallback:dartConversionValueUpdatedCallback
312+
skad4ConversionValueUpdatedCallback:dartSkad4ConversionValueUpdatedCallback
304313
shouldLaunchDeferredDeeplink:launchDeferredDeeplink
305314
andMethodChannel:self.channel]];
306315
}
@@ -691,6 +700,32 @@ - (void)getLastDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)resu
691700
}
692701
}
693702

703+
- (void)updateConversionValueWithErrorCallback:(FlutterMethodCall *)call withResult:(FlutterResult)result {
704+
NSString *conversionValue = call.arguments[@"conversionValue"];
705+
if ([self isFieldValid:conversionValue]) {
706+
[Adjust updatePostbackConversionValue:[conversionValue intValue]
707+
completionHandler:^(NSError * _Nullable error) {
708+
result([error localizedDescription]);
709+
}];
710+
}
711+
}
712+
713+
- (void)updateConversionValueWithErrorCallbackSkad4:(FlutterMethodCall *)call withResult:(FlutterResult)result {
714+
NSString *conversionValue = call.arguments[@"conversionValue"];
715+
NSString *coarseValue = call.arguments[@"coarseValue"];
716+
NSString *lockWindow = call.arguments[@"lockWindow"];
717+
if ([self isFieldValid:conversionValue] &&
718+
[self isFieldValid:coarseValue] &&
719+
[self isFieldValid:lockWindow]) {
720+
[Adjust updatePostbackConversionValue:[conversionValue intValue]
721+
coarseValue:coarseValue
722+
lockWindow:(BOOL)lockWindow
723+
completionHandler:^(NSError * _Nullable error) {
724+
result([error localizedDescription]);
725+
}];
726+
}
727+
}
728+
694729
- (void)setTestOptions:(FlutterMethodCall *)call withResult:(FlutterResult)result {
695730
AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
696731
NSString *baseUrl = call.arguments[@"baseUrl"];

ios/Classes/AdjustSdkDelegate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
eventFailureCallback:(NSString *)swizzleEventFailureCallback
2222
deferredDeeplinkCallback:(NSString *)swizzleDeferredDeeplinkCallback
2323
conversionValueUpdatedCallback:(NSString *)swizzleConversionValueUpdatedCallback
24+
skad4ConversionValueUpdatedCallback:(NSString *)swizzleSkad4ConversionValueUpdatedCallback
2425
shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
2526
andMethodChannel:(FlutterMethodChannel *)channel;
2627

ios/Classes/AdjustSdkDelegate.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
static NSString *dartEventFailureCallback;
1919
static NSString *dartDeferredDeeplinkCallback;
2020
static NSString *dartConversionValueUpdatedCallback;
21+
static NSString *dartSkad4ConversionValueUpdatedCallback;
2122

2223
@implementation AdjustSdkDelegate
2324

@@ -40,6 +41,7 @@ + (id)getInstanceWithSwizzleOfAttributionCallback:(NSString *)swizzleAttribution
4041
eventFailureCallback:(NSString *)swizzleEventFailureCallback
4142
deferredDeeplinkCallback:(NSString *)swizzleDeferredDeeplinkCallback
4243
conversionValueUpdatedCallback:(NSString *)swizzleConversionValueUpdatedCallback
44+
skad4ConversionValueUpdatedCallback:(NSString *)swizzleSkad4ConversionValueUpdatedCallback
4345
shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
4446
andMethodChannel:(FlutterMethodChannel *)channel {
4547

@@ -82,6 +84,11 @@ + (id)getInstanceWithSwizzleOfAttributionCallback:(NSString *)swizzleAttribution
8284
swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:)];
8385
dartConversionValueUpdatedCallback = swizzleConversionValueUpdatedCallback;
8486
}
87+
if (swizzleSkad4ConversionValueUpdatedCallback != nil) {
88+
[defaultInstance swizzleCallbackMethod:@selector(adjustConversionValueUpdated:coarseValue:lockWindow:)
89+
swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:coarseValue:lockWindow:)];
90+
dartSkad4ConversionValueUpdatedCallback = swizzleSkad4ConversionValueUpdatedCallback;
91+
}
8592

8693
[defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink];
8794
[defaultInstance setChannel:channel];
@@ -239,6 +246,18 @@ - (void)adjustConversionValueUpdatedWannabe:(NSNumber *)conversionValue {
239246
[self.channel invokeMethod:dartConversionValueUpdatedCallback arguments:conversionValueMap];
240247
}
241248

249+
- (void)adjustConversionValueUpdatedWannabe:(nullable NSNumber *)fineValue
250+
coarseValue:(nullable NSString *)coarseValue
251+
lockWindow:(nullable NSNumber *)lockWindow {
252+
id keys[] = { @"fineValue", @"coarseValue", @"lockWindow" };
253+
id values[] = { [fineValue stringValue], coarseValue, [lockWindow stringValue] };
254+
NSUInteger count = sizeof(values) / sizeof(id);
255+
NSDictionary *conversionValueMap = [NSDictionary dictionaryWithObjects:values
256+
forKeys:keys
257+
count:count];
258+
[self.channel invokeMethod:dartSkad4ConversionValueUpdatedCallback arguments:conversionValueMap];
259+
}
260+
242261
- (void)swizzleCallbackMethod:(SEL)originalSelector
243262
swizzledSelector:(SEL)swizzledSelector {
244263
Class class = [self class];

ios/adjust_sdk.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'adjust_sdk'
3-
s.version = '4.32.0'
3+
s.version = '4.33.0'
44
s.summary = 'Adjust Flutter SDK for iOS platform'
55
s.description = <<-DESC
66
Adjust Flutter SDK for iOS platform.
@@ -14,5 +14,5 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = '8.0'
1515

1616
s.dependency 'Flutter'
17-
s.dependency 'Adjust', '4.32.1'
17+
s.dependency 'Adjust', '4.33.2'
1818
end

0 commit comments

Comments
 (0)