Skip to content

Commit

Permalink
Revert "Cleanups and updates!"
Browse files Browse the repository at this point in the history
This reverts commit 4f63031.
  • Loading branch information
jonathansligh-nimbus committed Nov 19, 2024
1 parent 4f63031 commit cd0115a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
12 changes: 5 additions & 7 deletions com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,19 @@ private void OnGUI() {
#if NIMBUS_ENABLE_VUNGLE
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2);
GUILayout.Space(10);
EditorGUILayout.LabelField("Liftoff Monetize Configuration", headerStyle);
EditorGUILayout.LabelField("Vungle Configuration", headerStyle);
#if UNITY_ANDROID
var label = new GUIContent("Android Liftoff Monetize App ID");
EditorGUILayout.PropertyField(_androidVungleAppId, label);
EditorGUILayout.PropertyField((_androidVungleAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
#endif

#if UNITY_IOS
var label = new GUIContent("iOS Liftoff Monetize App ID");
EditorGUILayout.PropertyField(_iosVungleAppId, label);
EditorGUILayout.PropertyField((_iosVungleAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
#endif

#if !UNITY_ANDROID && !UNITY_IOS
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter Liftoff Monetize data", MessageType.Warning);
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter Vungle data", MessageType.Warning);
#endif
#endif

Expand Down Expand Up @@ -341,7 +339,7 @@ private bool ValidateVungleData() {

if (appId.IsNullOrEmpty()) {
Debug.unityLogger.LogError("Nimbus",
"Liftoff Monetize SDK has been included, the Liftoff Monetize App ID cannot be empty, object NimbusAdsManager not created");
"Vungle SDK has been included, the Vungle App ID cannot be empty, object NimbusAdsManager not created");
return false;
}
ApsSlotData[] slotData = null;
Expand Down
16 changes: 8 additions & 8 deletions com.adsbynimbus.nimbus/Editor/ThirdPartyMacros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ThirdPartyMacros : EditorWindow {
private const string Disabled = "Disabled";
private const string ButtonMessageTemplate = @"{0} {1} Build Macro For {2}?";
private const string ApsPartnerStr = "APS";
private const string VunglePartnerStr = "Liftoff Monetize";
private const string VunglePartnerStr = "Vungle";

private void OnEnable() {
UpdateSettings();
Expand Down Expand Up @@ -85,23 +85,23 @@ private void OnGUI() {
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2);

// START OF VUNGLE
EditorGUILayout.LabelField("Liftoff Monetize Build Macro Settings:", headerStyle);
EditorGUILayout.LabelField("Vungle Build Macro Settings:", headerStyle);
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2);
GUILayout.Space(10);

var vungleAndroidStatus = _androidVungleIsEnabled ? Enabled : Disabled;
EditorGUILayout.LabelField($"Macro is set for Android is: {vungleAndroidStatus}", headerStyle);
GUILayout.Space(2);
var androidVunglebuttonText = _androidVungleIsEnabled
? string.Format(ButtonMessageTemplate, "Remove", "Liftoff Monetize", "Android")
: string.Format(ButtonMessageTemplate, "Enable", "Liftoff Monetize", "Android");
? string.Format(ButtonMessageTemplate, "Remove", "Vungle", "Android")
: string.Format(ButtonMessageTemplate, "Enable", "Vungle", "Android");
if (GUILayout.Button(androidVunglebuttonText)) {
if (_androidVungleIsEnabled) {
RemoveBuildMacroForGroup(BuildTargetGroup.Android, VungleMacro);
}
else {
SetBuildMacroForGroup(BuildTargetGroup.Android, VungleMacro);
EditorUtil.LogWithHelpBox("Don't Forget To Add your Liftoff Monetize Android App Id to the " +
EditorUtil.LogWithHelpBox("Don't Forget To Add your Android Vungle App Id to the " +
"NimbusSDKConfiguration Scriptable object attached to your NimbusAdManager game object", MessageType.Warning);
FocusOnGameManager(VunglePartnerStr);
}
Expand All @@ -113,15 +113,15 @@ private void OnGUI() {
EditorGUILayout.LabelField($"Macro is set for Ios is: {vungleIosStatus}", headerStyle);
GUILayout.Space(2);
var vungleAndroidButtonText = _iosVungleIsEnabled
? string.Format(ButtonMessageTemplate, "Remove", "Liftoff Monetize", "Ios")
: string.Format(ButtonMessageTemplate, "Enable", "Liftoff Monetize", "Ios");
? string.Format(ButtonMessageTemplate, "Remove", "Vungle", "Ios")
: string.Format(ButtonMessageTemplate, "Enable", "Vungle", "Ios");
if (GUILayout.Button(vungleAndroidButtonText)) {
if (_iosVungleIsEnabled) {
RemoveBuildMacroForGroup(BuildTargetGroup.iOS, VungleMacro);
}
else {
SetBuildMacroForGroup(BuildTargetGroup.iOS, VungleMacro);
EditorUtil.LogWithHelpBox("Don't Forget To Add your Liftoff Monetize IOS App Id to the " +
EditorUtil.LogWithHelpBox("Don't Forget To Add your IOS Vungle App Id to the " +
"NimbusSDKConfiguration Scriptable object attached to your NimbusAdManager game object", MessageType.Warning);
FocusOnGameManager(VunglePartnerStr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal override void InitializeSDK(NimbusSDKConfiguration configuration) {
_interceptors.Add(aps);
#endif
#if NIMBUS_ENABLE_VUNGLE
Debug.unityLogger.Log("Initializing iOS Liftoff Monetize SDK");
Debug.unityLogger.Log("Initializing iOS Vungle SDK");
var appID = configuration.GetVungleData();
var vungle = new VungleIOS(appID);
vungle.InitializeNativeSDK();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) {
if (data.IsNullOrEmpty()) {
return bidRequest;
}
if (bidRequest.User.Ext == null) {
bidRequest.User.Ext = new UserExt();
if (bidRequest.User.Ext != null) {
bidRequest.User.Ext.VungleBuyerId = data;
}
bidRequest.User.Ext.VungleBuyerId = data;

return bidRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) {
if (data.IsNullOrEmpty()) {
return bidRequest;
}
if (bidRequest.User.Ext == null) {
bidRequest.User.Ext = new UserExt();
if (bidRequest.User.Ext != null) {
bidRequest.User.Ext.VungleBuyerId = data;
}
bidRequest.User.Ext.VungleBuyerId = data;

return bidRequest;
}

public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) {
return _fetchVungleBuyerId();
public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen)
{
var buyerId = _fetchVungleBuyerId();
Debug.unityLogger.Log("VUNGLEBUYER", buyerId);
return buyerId;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ public override void OnInspectorGUI() {
GUILayout.Space(10);
EditorGUILayout.LabelField("APS Configuration", headerStyle);
#if UNITY_ANDROID
EditorGUILayout.PropertyField(_androidAppId);
EditorGUILayout.PropertyField((_androidAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
EditorDrawUtility.DrawArray(_androidApsSlots, "Android Slot Id Data");
#endif

#if UNITY_IOS
EditorGUILayout.PropertyField(_iosAppId);
EditorGUILayout.PropertyField((_iosAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
EditorDrawUtility.DrawArray(_iosApsSlots, "iOS Slot Id Data");
#endif
Expand All @@ -164,21 +164,19 @@ public override void OnInspectorGUI() {
#if NIMBUS_ENABLE_VUNGLE
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2);
GUILayout.Space(10);
EditorGUILayout.LabelField("Liftoff Monetize Configuration", headerStyle);
EditorGUILayout.LabelField("Vungle Configuration", headerStyle);
#if UNITY_ANDROID
var label = new GUIContent("Android Liftoff Monetize App ID");
EditorGUILayout.PropertyField(_androidVungleAppId, label);
EditorGUILayout.PropertyField((_androidVungleAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
#endif

#if UNITY_IOS
var label = new GUIContent("iOS Liftoff Monetize App ID");
EditorGUILayout.PropertyField(_iosVungleAppId, label);
EditorGUILayout.PropertyField((_iosVungleAppId));
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray);
#endif

#if !UNITY_ANDROID && !UNITY_IOS
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter Liftoff Monetize data", MessageType.Warning);
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter Vungle data", MessageType.Warning);
#endif
#endif

Expand Down

0 comments on commit cd0115a

Please sign in to comment.