public void trackEvent(AdjustEvent adjustEvent) { AdjustWP.TrackEvent ( eventToken: adjustEvent.eventToken, revenue: adjustEvent.revenue, currency: adjustEvent.currency, callbackList: adjustEvent.callbackList, partnerList: adjustEvent.partnerList ); }
public void trackEvent(AdjustEvent adjustEvent) { double revenue = convertDouble (adjustEvent.revenue); string eventToken = adjustEvent.eventToken; string currency = adjustEvent.currency; string stringJsonCallBackParameters = ConvertListToJson (adjustEvent.callbackList); string stringJsonPartnerParameters = ConvertListToJson (adjustEvent.partnerList); _AdjustTrackEvent (eventToken, revenue, currency, stringJsonCallBackParameters, stringJsonPartnerParameters); }
public static void TrackEvent(AdjustEvent adjustEvent) { AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken); // Check if user has set revenue for the event. if (adjustEvent.revenue != null) { ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.revenue, adjustEvent.currency); } // Check if user has added any callback parameters to the event. if (adjustEvent.callbackList != null) { for (int i = 0; i < adjustEvent.callbackList.Count; i += 2) { string key = adjustEvent.callbackList[i]; string value = adjustEvent.callbackList[i + 1]; ajoAdjustEvent.Call("addCallbackParameter", key, value); } } // Check if user has added any partner parameters to the event. if (adjustEvent.partnerList != null) { for (int i = 0; i < adjustEvent.partnerList.Count; i += 2) { string key = adjustEvent.partnerList[i]; string value = adjustEvent.partnerList[i + 1]; ajoAdjustEvent.Call("addPartnerParameter", key, value); } } // Check if user has added transaction ID to the event. if (adjustEvent.transactionId != null) { ajoAdjustEvent.Call("setOrderId", adjustEvent.transactionId); } // Check if user has added callback ID to the event. if (adjustEvent.callbackId != null) { ajoAdjustEvent.Call("setCallbackId", adjustEvent.callbackId); } // Track the event. ajcAdjust.CallStatic("trackEvent", ajoAdjustEvent); }
public static void TrackEvent(AdjustEvent adjustEvent) { AndroidJavaObject androidJavaObject = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken); double? revenue = adjustEvent.revenue; if (revenue.HasValue) { AndroidJavaObject androidJavaObject2 = androidJavaObject; object[] array = new object[2]; double? revenue2 = adjustEvent.revenue; array[0] = revenue2.Value; array[1] = adjustEvent.currency; androidJavaObject2.Call("setRevenue", array); } if (adjustEvent.callbackList != null) { for (int i = 0; i < adjustEvent.callbackList.Count; i += 2) { string text = adjustEvent.callbackList[i]; string text2 = adjustEvent.callbackList[i + 1]; androidJavaObject.Call("addCallbackParameter", text, text2); } } if (adjustEvent.partnerList != null) { for (int j = 0; j < adjustEvent.partnerList.Count; j += 2) { string text3 = adjustEvent.partnerList[j]; string text4 = adjustEvent.partnerList[j + 1]; androidJavaObject.Call("addPartnerParameter", text3, text4); } } if (adjustEvent.transactionId != null) { androidJavaObject.Call("setOrderId", adjustEvent.transactionId); } if (adjustEvent.callbackId != null) { androidJavaObject.Call("setCallbackId", adjustEvent.callbackId); } ajcAdjust.CallStatic("trackEvent", androidJavaObject); }
public static void trackEvent(AdjustEvent adjustEvent) { if (!Application.isEditor) { if (adjustEvent == null) { Debug.Log("Adjust: Missing event to track."); return; } #if UNITY_IOS AdjustiOS.TrackEvent(adjustEvent); #elif UNITY_ANDROID AdjustAndroid.TrackEvent(adjustEvent); #elif (UNITY_WSA || UNITY_WP8) AdjustWindows.TrackEvent(adjustEvent); #else Debug.Log(errorMsgPlatform); #endif } }
public static void TrackEvent(AdjustEvent adjustEvent) { AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken); if (adjustEvent.revenue != null) { ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.revenue, adjustEvent.currency); } if (adjustEvent.callbackList != null) { for (int i = 0; i < adjustEvent.callbackList.Count; i += 2) { string key = adjustEvent.callbackList[i]; string value = adjustEvent.callbackList[i + 1]; ajoAdjustEvent.Call("addCallbackParameter", key, value); } } if (adjustEvent.partnerList != null) { for (int i = 0; i < adjustEvent.partnerList.Count; i += 2) { string key = adjustEvent.partnerList[i]; string value = adjustEvent.partnerList[i + 1]; ajoAdjustEvent.Call("addPartnerParameter", key, value); } } if (adjustEvent.transactionId != null) { ajoAdjustEvent.Call("setOrderId", adjustEvent.transactionId); } ajcAdjust.CallStatic("trackEvent", ajoAdjustEvent); }
public void trackEvent(AdjustEvent adjustEvent) { AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject ("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken); if (adjustEvent.revenue != null && adjustEvent.currency != null) { ajoAdjustEvent.Call ("setRevenue", (double)adjustEvent.revenue, adjustEvent.currency); } if (adjustEvent.callbackList != null) { for (int i = 0; i < adjustEvent.callbackList.Count; i += 2) { string key = adjustEvent.callbackList [i]; string value = adjustEvent.callbackList [i + 1]; ajoAdjustEvent.Call ("addCallbackParameter", key, value); } } if (adjustEvent.partnerList != null) { for (int i = 0; i < adjustEvent.partnerList.Count; i += 2) { string key = adjustEvent.partnerList [i]; string value = adjustEvent.partnerList [i + 1]; ajoAdjustEvent.Call ("addPartnerParameter", key, value); } } ajcAdjust.CallStatic ("trackEvent", ajoAdjustEvent); }
public static void trackEvent(AdjustEvent adjustEvent) { if (Adjust.instance == null) { Debug.Log (Adjust.errorMessage); return; } if (adjustEvent == null) { Debug.Log ("adjust: Missing event to track."); return; } Adjust.instance.trackEvent (adjustEvent); }
void OnGUI() { if (showPopUp) { GUI.Window(0, new Rect((Screen.width / 2) - 150, (Screen.height / 2) - 65, 300, 130), showGUI, "Is SDK enabled?"); } if (GUI.Button (new Rect (0, Screen.height * 0 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtManualLaunch)) { if (!string.Equals(txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase)) { AdjustConfig adjustConfig = new AdjustConfig ("{YourAppToken}", AdjustEnvironment.Sandbox); adjustConfig.setLogLevel (AdjustLogLevel.Verbose); adjustConfig.setAttributionChangedDelegate (this.attributionChangedDelegate); Adjust.start (adjustConfig); isEnabled = true; txtManualLaunch = "SDK Launched"; } } if (GUI.Button (new Rect (0, Screen.height * 1 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Simple Event")) { AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}"); Adjust.trackEvent (adjustEvent); } if (GUI.Button (new Rect (0, Screen.height * 2 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Revenue Event")) { AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}"); adjustEvent.setRevenue (0.25, "EUR"); Adjust.trackEvent (adjustEvent); } if (GUI.Button (new Rect (0, Screen.height * 3 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Callback Event")) { AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}"); adjustEvent.addCallbackParameter ("key", "value"); adjustEvent.addCallbackParameter ("foo", "bar"); Adjust.trackEvent (adjustEvent); } if (GUI.Button (new Rect (0, Screen.height * 4 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Partner Event")) { AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}"); adjustEvent.addPartnerParameter ("key", "value"); adjustEvent.addPartnerParameter ("foo", "bar"); Adjust.trackEvent (adjustEvent); } if (GUI.Button (new Rect (0, Screen.height * 5 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetOfflineMode)) { if (string.Equals(txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase)) { Adjust.setOfflineMode(true); txtSetOfflineMode = "Turn Offline Mode OFF"; } else { Adjust.setOfflineMode(false); txtSetOfflineMode = "Turn Offline Mode ON"; } } if (GUI.Button (new Rect (0, Screen.height * 6 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetEnabled)) { if (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase)) { Adjust.setEnabled(false); txtSetEnabled = "Enable SDK"; } else { Adjust.setEnabled(true); txtSetEnabled = "Disable SDK"; } } if (GUI.Button (new Rect (0, Screen.height * 7 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Is SDK Enabled?")) { isEnabled = Adjust.isEnabled(); showPopUp = true; } }