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

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Adjust/Adjust.cs

Lines changed: 15 additions & 0 deletions
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

Lines changed: 11 additions & 1 deletion
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

Lines changed: 20 additions & 21 deletions
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

Lines changed: 8 additions & 0 deletions
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 + "'");

0 commit comments

Comments
 (0)