Skip to content

Commit 94e07b1

Browse files
committed
Merge pull request #50 from adjust/windows
Windows
2 parents e3fc6e1 + 26a5c19 commit 94e07b1

File tree

109 files changed

+2626
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2626
-27
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "ext/iOS/sdk"]
55
path = ext/iOS/sdk
66
url = [email protected]:adjust/ios_sdk.git
7+
[submodule "ext/Windows/sdk"]
8+
path = ext/Windows/sdk
9+
url = https://github.com/adjust/windows_sdk.git

Assets/Adjust/Adjust.cs

+22-3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public static void start (AdjustConfig adjustConfig)
7575
Adjust.instance = new AdjustiOS ();
7676
#elif UNITY_ANDROID
7777
Adjust.instance = new AdjustAndroid ();
78+
#elif UNITY_WP8
79+
Adjust.instance = new AdjustWP8 ();
80+
#elif UNITY_METRO
81+
Adjust.instance = new AdjustMetro ();
7882
#else
7983
Adjust.instance = null;
8084
#endif
@@ -160,10 +164,10 @@ public static void setReferrer (string referrer)
160164

161165
public void getNativeMessage (string sAttributionData)
162166
{
163-
Adjust.runAttributionChangedDelegate (sAttributionData);
167+
Adjust.runAttributionChangedString (sAttributionData);
164168
}
165-
166-
public static void runAttributionChangedDelegate (string stringAttributionData)
169+
170+
public static void runAttributionChangedString (string stringAttributionData)
167171
{
168172
if (instance == null) {
169173
Debug.Log (Adjust.errorMessage);
@@ -179,6 +183,21 @@ public static void runAttributionChangedDelegate (string stringAttributionData)
179183
Adjust.attributionChangedDelegate (attribution);
180184
}
181185

186+
public static void runAttributionChangedDictionary (Dictionary<string, string> dicAttributionData)
187+
{
188+
if (instance == null) {
189+
Debug.Log (Adjust.errorMessage);
190+
return;
191+
}
192+
if (Adjust.attributionChangedDelegate == null) {
193+
Debug.Log ("adjust: Attribution changed delegate was not set.");
194+
return;
195+
}
196+
197+
var attribution = new AdjustAttribution (dicAttributionData);
198+
Adjust.attributionChangedDelegate (attribution);
199+
}
200+
182201
#endregion
183202

184203
#region Private & helper methods

Assets/Adjust/AdjustUnityWP.dll

4.5 KB
Binary file not shown.

Assets/Adjust/AdjustUnityWP.dll.meta

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

Assets/Adjust/AdjustUnityWS.dll

4.5 KB
Binary file not shown.

Assets/Adjust/AdjustUnityWS.dll.meta

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

Assets/Adjust/Android/AdjustAndroid.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace com.adjust.sdk
1010
#if UNITY_ANDROID
1111
public class AdjustAndroid : IAdjust
1212
{
13-
private const string sdkPrefix = "unity4.0.4";
13+
private const string sdkPrefix = "unity4.1.0";
1414
private AndroidJavaClass ajcAdjust;
1515
private AndroidJavaObject ajoCurrentActivity;
1616
private AttributionChangeListener onAttributionChangedListener;

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

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

Assets/Adjust/ExampleGUI/ExampleGUI.cs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Runtime.InteropServices;
44

55
using UnityEngine;
6-
using UnityEngine.UI;
76
using com.adjust.sdk;
87

98
public class ExampleGUI : MonoBehaviour
-5 KB
Binary file not shown.

Assets/Adjust/ExampleGUI/ExampleGUI.unity.meta

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

Assets/Adjust/Metro.meta

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

Assets/Adjust/Metro/AdjustMetro.cs

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#if UNITY_METRO
2+
using UnityEngine;
3+
using System.Collections;
4+
using AdjustUnityWS;
5+
using System;
6+
using System.Collections.Generic;
7+
8+
namespace com.adjust.sdk
9+
{
10+
public class AdjustMetro : IAdjust
11+
{
12+
private const string sdkPrefix = "unity4.1.0";
13+
14+
public bool isEnabled()
15+
{
16+
return AdjustWS.IsEnabled();
17+
}
18+
public void onPause ()
19+
{
20+
AdjustWS.ApplicationDeactivated ();
21+
}
22+
public void onResume()
23+
{
24+
AdjustWS.ApplicationActivated ();
25+
}
26+
public void setEnabled(bool enabled)
27+
{
28+
AdjustWS.SetEnabled (enabled);
29+
}
30+
public void setOfflineMode(bool offlineMode)
31+
{
32+
AdjustWS.SetOfflineMode (offlineMode);
33+
}
34+
public void start(AdjustConfig adjustConfig)
35+
{
36+
string logLevelString = null;
37+
if (adjustConfig.logLevel != null)
38+
{
39+
logLevelString = adjustConfig.logLevel.ToString();
40+
}
41+
42+
Action<Dictionary<string, string>> attributionChangedDictionary = null;
43+
if (adjustConfig.attributionChangedDelegate != null)
44+
{
45+
attributionChangedDictionary = (attributionDictionary) => Adjust.runAttributionChangedDictionary(attributionDictionary);
46+
}
47+
48+
AdjustWS.ApplicationLaunching (
49+
appToken: adjustConfig.appToken,
50+
logLevelString: logLevelString,
51+
environment: adjustConfig.environment.ToString ().ToLower (),
52+
defaultTracker: adjustConfig.defaultTracker,
53+
eventBufferingEnabled: adjustConfig.eventBufferingEnabled,
54+
sdkPrefix: sdkPrefix,
55+
attributionChangedDic: attributionChangedDictionary
56+
);
57+
}
58+
public void trackEvent (AdjustEvent adjustEvent)
59+
{
60+
AdjustWS.TrackEvent (
61+
eventToken: adjustEvent.eventToken,
62+
revenue: adjustEvent.revenue,
63+
currency: adjustEvent.currency,
64+
callbackList: adjustEvent.callbackList,
65+
partnerList: adjustEvent.partnerList
66+
);
67+
}
68+
// iOS specific methods
69+
public void setDeviceToken (string deviceToken) {}
70+
// Android specific methods
71+
public void setReferrer (string referrer) {}
72+
}
73+
}
74+
#endif

Assets/Adjust/Metro/AdjustMetro.cs.meta

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

Assets/Adjust/Metro/AdjustUnityWS.dll

6.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)