Skip to content

Commit ff2eff3

Browse files
authored
Merge pull request #149 from adjust/v4180
Version 4.18.0
2 parents 724c8fe + 3d6c80e commit ff2eff3

39 files changed

+890
-734
lines changed

Assets/Adjust.meta

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Adjust/Adjust.cs

+15
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,21 @@ public static void resetSessionCallbackParameters()
317317
#endif
318318
}
319319

320+
public static void trackAdRevenue(string source, string payload)
321+
{
322+
if (IsEditor()) { return; }
323+
324+
#if UNITY_IOS
325+
AdjustiOS.TrackAdRevenue(source, payload);
326+
#elif UNITY_ANDROID
327+
AdjustAndroid.TrackAdRevenue(source, payload);
328+
#elif (UNITY_WSA || UNITY_WP8)
329+
Debug.Log("Ad revenue tracking is only supported for Android and iOS platforms.")
330+
#else
331+
Debug.Log(errorMsgPlatform);
332+
#endif
333+
}
334+
320335
public static string getAdid()
321336
{
322337
if (IsEditor()) { return string.Empty; }

Assets/Adjust/Adjust.prefab

-3.05 KB
Binary file not shown.

Assets/Adjust/Android/AdjustAndroid.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace com.adjust.sdk
88
#if UNITY_ANDROID
99
public class AdjustAndroid
1010
{
11-
private const string sdkPrefix = "unity4.17.2";
11+
private const string sdkPrefix = "unity4.18.0";
1212
private static bool launchDeferredDeeplink = 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");
@@ -350,6 +350,16 @@ public static void AppWillOpenUrl(string url)
350350
ajcAdjust.CallStatic("appWillOpenUrl", ajoUri, ajoCurrentActivity);
351351
}
352352

353+
public static void TrackAdRevenue(string source, string payload)
354+
{
355+
if (ajcAdjust == null)
356+
{
357+
ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
358+
}
359+
AndroidJavaObject jsonPayload = new AndroidJavaObject("org.json.JSONObject", payload);
360+
ajcAdjust.CallStatic("trackAdRevenue", source, jsonPayload);
361+
}
362+
353363
// Android specific methods.
354364
public static void OnPause()
355365
{
22 Bytes
Binary file not shown.
1.95 KB
Binary file not shown.

Assets/Adjust/Android/adjust-android.jar.meta

+20-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-4.3 KB
Binary file not shown.
-260 Bytes
Binary file not shown.

Assets/Adjust/Test/CommandExecutor.cs

+8
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void ExecuteCommand(Command command)
6565
case "openDeeplink": OpenDeepLink(); break;
6666
case "sendReferrer": SetReferrer(); break;
6767
case "gdprForgetMe": GdprForgetMe(); break;
68+
case "trackAdRevenue": TrackAdRevenue(); break;
6869

6970
default: CommandNotFound(_command.ClassName, _command.MethodName); break;
7071
}
@@ -682,6 +683,13 @@ private void OpenDeepLink()
682683
Adjust.appWillOpenUrl(deeplink);
683684
}
684685

686+
private void TrackAdRevenue()
687+
{
688+
string source = _command.GetFirstParameterValue("adRevenueSource");
689+
string payload = _command.GetFirstParameterValue("adRevenueJsonString");
690+
Adjust.trackAdRevenue(source, payload);
691+
}
692+
685693
private void CommandNotFound(string className, string methodName)
686694
{
687695
TestApp.Log("adjust test: Method '" + methodName + "' not found for class '" + className + "'");

Assets/Adjust/Test/TestApp.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public class TestApp : MonoBehaviour
1616
#elif UNITY_ANDROID
1717
private const string PORT = ":8443";
1818
private const string PROTOCOL = "https://";
19-
private const string IP = "192.168.8.98";
19+
private const string IP = "192.168.8.207";
2020
#elif UNITY_IOS
2121
private const string PORT = ":8080";
2222
private const string PROTOCOL = "http://";
23-
private const string IP = "192.168.8.98";
23+
private const string IP = "192.168.8.207";
2424
private TestLibraryiOS _testLibraryiOS;
2525
#endif
2626
private const string BASE_URL = PROTOCOL + IP + PORT;

Assets/Adjust/Test/TestApp.unity

-3.35 KB
Binary file not shown.

Assets/Adjust/Unity/AdjustConfig.cs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ namespace com.adjust.sdk
44
{
55
public class AdjustConfig
66
{
7+
public const string AdjustAdRevenueSourceMopub = "mopub";
8+
79
internal string appToken;
810
internal string sceneName;
911
internal string userAgent;

Assets/Adjust/Windows/AdjustWindows.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace com.adjust.sdk
1717
{
1818
public class AdjustWindows
1919
{
20-
private const string sdkPrefix = "unity4.17.2";
20+
private const string sdkPrefix = "unity4.18.0";
2121
private static bool appLaunched = false;
2222

2323
public static void Start(AdjustConfig adjustConfig)

Assets/Adjust/iOS/ADJAttribution.h.meta

+15-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Adjust/iOS/ADJConfig.h.meta

+15-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Adjust/iOS/ADJEvent.h.meta

+15-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)