Skip to content

Commit 21fcef5

Browse files
authored
Merge pull request #328 from adjust/v511
Version 5.1.1
2 parents 19a71e8 + 6600458 commit 21fcef5

File tree

7 files changed

+30
-17
lines changed

7 files changed

+30
-17
lines changed

Assets/Adjust/Native/iOS/AdjustUnity.mm

+7-6
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,13 @@ void _AdjustGetAttribution(AdjustDelegateAttributionGetter callback) {
372372
addValueOrEmpty(dictionary, @"costType", attribution.costType);
373373
addValueOrEmpty(dictionary, @"costAmount", attribution.costAmount);
374374
addValueOrEmpty(dictionary, @"costCurrency", attribution.costCurrency);
375-
376-
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
377-
options:0
378-
error:nil];
379-
NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
380-
addValueOrEmpty(dictionary, @"jsonResponse", strJsonResponse);
375+
if (attribution.jsonResponse != nil) {
376+
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
377+
options:0
378+
error:nil];
379+
NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
380+
addValueOrEmpty(dictionary, @"jsonResponse", strJsonResponse);
381+
}
381382

382383
NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary
383384
options:0

Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm

+9-7
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
124124
forKey:@"costCurrency"
125125
toDictionary:dictionary];
126126

127-
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
128-
options:0
129-
error:nil];
130-
NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
131-
[self addValueOrEmpty:strJsonResponse
132-
forKey:@"jsonResponse"
133-
toDictionary:dictionary];
127+
if (attribution.jsonResponse != nil) {
128+
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
129+
options:0
130+
error:nil];
131+
NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
132+
[self addValueOrEmpty:strJsonResponse
133+
forKey:@"jsonResponse"
134+
toDictionary:dictionary];
135+
}
134136

135137
NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary
136138
options:0

Assets/Adjust/Scripts/AdjustAndroid.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AdjustSdk
88
#if UNITY_ANDROID
99
public class AdjustAndroid
1010
{
11-
private const string sdkPrefix = "unity5.1.0";
11+
private const string sdkPrefix = "unity5.1.1";
1212
private static bool isDeferredDeeplinkOpeningEnabled = true;
1313
private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
1414
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");

Assets/Adjust/Scripts/AdjustiOS.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AdjustSdk
88
#if UNITY_IOS
99
public class AdjustiOS
1010
{
11-
private const string sdkPrefix = "unity5.1.0";
11+
private const string sdkPrefix = "unity5.1.1";
1212

1313
// app callbacks as method parameters
1414
private static List<Action<bool>> appIsEnabledGetterCallbacks;

Assets/Adjust/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.adjust.sdk",
3-
"version": "5.1.0",
3+
"version": "5.1.1",
44
"unity": "2019.4",
55
"displayName": "Adjust",
66
"license": "MIT",

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Version 5.1.1 (March 5th 2025)
2+
#### Fixed
3+
- Added missing null checks for native `jsonResponse` fields (https://github.com/adjust/flutter_sdk/pull/160).
4+
5+
#### Native SDKs
6+
- [[email protected]][ios_sdk_v5.1.1]
7+
- [[email protected]][android_sdk_v5.1.0]
8+
9+
---
10+
111
### Version 5.1.0 (28th February 2025)
212
#### Added
313
- Added `JsonResponse` to `AdjustAttribution` where every key-value pair sent by the backend as part of the attribution response can be found.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.0
1+
5.1.1

0 commit comments

Comments
 (0)