Skip to content

Commit

Permalink
Release 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Str4tos committed Dec 28, 2020
1 parent b975b50 commit 6611770
Show file tree
Hide file tree
Showing 31 changed files with 1,005 additions and 360 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Clever Ads Solutions Unity Plugin Change Log

## [1.9.1] - 2020-12-28
### Dependencies
- [Android] Wraps [1.9.1 SDK](https://github.com/cleveradssolutions/CAS-Android/releases)
- [iOS] Wraps [1.9.1 SDK](https://github.com/cleveradssolutions/CAS-iOS/releases)
### Features
- Added `CAS.MobileAds.BuildManager().Initialize()` [builder](https://github.com/cleveradssolutions/CAS-Unity#step-4-initialize-cas-sdk) to initialize the `IMediationManager` for alternative to `CAS.MobileAds.Initialize(...)` method.
- Added [Mediation extras](https://github.com/cleveradssolutions/CAS-Unity#mediation-extras) options.
- [iOS] Added `CAS.iOS.AppTrackingTransparency` class that provides a [tracking authorization request](https://github.com/cleveradssolutions/CAS-Unity#include-ios).
### Changes
- Migrated Cross-promotion dependency from `Advanced Integration` to `Solutions` section.
- `CAS.MobileAds.InitializeFromResources()` is obsolete in favor of `BuildManager()`.
- [iOS] `SKAdNetworkItems` are added to end of the Plist array instead of replacing all items in the array.
### Bug Fixes
- [iOS] `Library not loaded` while laoding application with Unity 2019.3+. The `Unity-iPhone` pod target is added automatically after build.
- [Android] `java.lang.NoSuchMethodError` when call `CAS.MobileAds.ValidateIntegration()`
- [Editor] Select the correct CAS Settings asset from resources by the build target platform.

## [1.8.3] - 2020-12-18
### Dependencies
- [Android] Wraps [1.8.3 SDK](https://github.com/cleveradssolutions/CAS-Android/releases)
Expand Down
2 changes: 1 addition & 1 deletion Editor/CASEditorUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class CASEditorUtils
internal const string gitUnityRepo = "CAS-Unity";
internal const string gitUnityRepoURL = gitRootURL + gitUnityRepo;
internal const string supportURL = gitUnityRepoURL + "#support";
internal const string configuringPrivacyURL = gitUnityRepoURL + "#step-2-configuring-cas-sdk";
internal const string configuringPrivacyURL = gitUnityRepoURL + "#include-ios";
internal const string websiteURL = "https://cleveradssolutions.com";

internal const string generalDeprecateDependency = "General";
Expand Down
39 changes: 6 additions & 33 deletions Editor/CASInitSettignsInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ internal class CASInitSettignsInspector : Editor
private bool allowedPackageUpdate;
private string newCASVersion;
private bool deprecateDependenciesExist;
private bool usingMultidexOnBuild;
//private bool usingMultidexOnBuild;

private int editorRuntimeActiveAdFlags;
private GUIStyle boxScopeStyle = null;
private GUIStyle wordWrapTextAred = null;

private void OnEnable()
{
Expand Down Expand Up @@ -73,7 +71,7 @@ private void OnEnable()

allowedPackageUpdate = Utils.IsPackageExist( Utils.packageName );
newCASVersion = Utils.GetNewVersionOrNull( Utils.gitUnityRepo, MobileAds.wrapperVersion, false );
usingMultidexOnBuild = PlayerPrefs.GetInt( Utils.editorIgnoreMultidexPrefs, 0 ) == 0;
//usingMultidexOnBuild = PlayerPrefs.GetInt( Utils.editorIgnoreMultidexPrefs, 0 ) == 0;

dependencyManager = DependencyManager.Create( platform, ( Audience )audienceTaggedProp.enumValueIndex, true );
}
Expand All @@ -96,15 +94,9 @@ public override void OnInspectorGUI()
var obj = serializedObject;
obj.UpdateIfRequiredOrScript();

if (wordWrapTextAred == null)
{
wordWrapTextAred = new GUIStyle( EditorStyles.textArea );
wordWrapTextAred.wordWrap = true;
}

LinksToolbarGUI();

BeginBoxScope();
HelpStyles.BeginBoxScope();
EditorGUILayout.PropertyField( testAdModeProp );
EditorGUI.BeginDisabledGroup( testAdModeProp.boolValue );
managerIdsList.DoLayoutList();
Expand All @@ -115,7 +107,7 @@ public override void OnInspectorGUI()

GUILayout.Label( "These settings are required for initialization with: CAS.MobileAds.InitializeFromResources(0)",
EditorStyles.wordWrappedMiniLabel, GUILayout.ExpandHeight( false ) );
EndBoxScope();
HelpStyles.EndBoxScope();

DrawSeparator();
OnAudienceGUI();
Expand Down Expand Up @@ -154,9 +146,7 @@ public override void OnInspectorGUI()
}
else
{
BeginBoxScope();
dependencyManager.OnGUI( platform );
EndBoxScope();
}

obj.ApplyModifiedProperties();
Expand Down Expand Up @@ -226,8 +216,8 @@ private void OnIOSLocationUsageDescriptionGUI()
EditorGUILayout.EndHorizontal();
EditorGUI.indentLevel++;
trackingUsageDescriptionProp.stringValue =
EditorGUILayout.TextArea( trackingUsageDescriptionProp.stringValue, wordWrapTextAred );
EditorGUILayout.HelpBox( "NSUserTrackingUsageDescription key with a custom message describing your usage. Can be empty.", MessageType.None );
EditorGUILayout.TextArea( trackingUsageDescriptionProp.stringValue, HelpStyles.wordWrapTextAred );
EditorGUILayout.HelpBox( "NSUserTrackingUsageDescription key with a custom message describing your usage location tracking to AppTrackingTransparency.Request(). Can be empty if not using location tracking", MessageType.None );

EditorGUI.indentLevel--;
EditorGUILayout.PropertyField( trackLocationEnabledProp );
Expand Down Expand Up @@ -367,23 +357,6 @@ private void DeprecatedDependenciesGUI()
EditorGUILayout.EndHorizontal();
}
}

private void BeginBoxScope()
{
if (boxScopeStyle == null)
{
boxScopeStyle = new GUIStyle( EditorStyles.helpBox );
var p = boxScopeStyle.padding;
p.right += 3;
p.left += 3;
}
EditorGUILayout.BeginVertical( boxScopeStyle );
}

private void EndBoxScope()
{
EditorGUILayout.EndVertical();
}
}
}
#pragma warning restore 649
142 changes: 103 additions & 39 deletions Editor/CASInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,83 @@

namespace CAS.UEditor
{

internal static class HelpStyles
{
private static GUIStyle boxScopeStyle;
public static GUIStyle wordWrapTextAred;

public static GUIContent helpIconContent;
public static GUIContent errorIconContent;
private static GUIContent tempContent;


static HelpStyles()
{
boxScopeStyle = new GUIStyle( EditorStyles.helpBox );
boxScopeStyle.padding = new RectOffset( 6, 6, 6, 6 );
wordWrapTextAred = new GUIStyle( EditorStyles.textArea );
wordWrapTextAred.wordWrap = true;

errorIconContent = EditorGUIUtility.IconContent( "d_console.erroricon.sml" );
helpIconContent = EditorGUIUtility.IconContent( "_Help" );
tempContent = new GUIContent();
}

public static void OnLabelGUI( Dependency.Label label )
{
if (label == Dependency.Label.None)
return;
if (( label & Dependency.Label.Banner ) == Dependency.Label.Banner)
{
tempContent.text = "B";
tempContent.tooltip = "Support Banner Ad";
GUILayout.Label( tempContent, "AssetLabel", GUILayout.ExpandWidth( false ) );
}
else
{
GUILayout.Label( " B ", GUILayout.ExpandWidth( false ) );
}
if (( label & Dependency.Label.Inter ) == Dependency.Label.Inter)
{
tempContent.text = "I";
tempContent.tooltip = "Support Interstitial Ad";
GUILayout.Label( tempContent, "AssetLabel", GUILayout.ExpandWidth( false ) );
}
else
{
GUILayout.Label( " I ", GUILayout.ExpandWidth( false ) );
}
if (( label & Dependency.Label.Reward ) == Dependency.Label.Reward)
{
tempContent.text = "R";
tempContent.tooltip = "Support Rewarded Video Ad";
GUILayout.Label( tempContent, "AssetLabel", GUILayout.ExpandWidth( false ) );
}
else
{
GUILayout.Label( " R ", GUILayout.ExpandWidth( false ) );
}
if (( label & Dependency.Label.Beta ) == Dependency.Label.Beta)
{
tempContent.text = "beta";
tempContent.tooltip = "Dependencies in closed beta and available upon invite only. " +
"If you would like to be considered for the beta, please contact Support.";
GUILayout.Label( tempContent, "AssetLabel", GUILayout.ExpandWidth( false ) );
}
}

public static void BeginBoxScope()
{
EditorGUILayout.BeginVertical( boxScopeStyle );
}

public static void EndBoxScope()
{
EditorGUILayout.EndVertical();
}
}

public partial class DependencyManager
{
#region Internal implementation
Expand All @@ -18,9 +95,6 @@ public partial class DependencyManager
private List<AdDependency> other = new List<AdDependency>();

internal GUILayoutOption columnWidth;
internal GUILayoutOption nameColumnWidth;
internal GUIContent helpIconContent = null;
internal GUIContent betaContent = null;

internal bool installedAny;

Expand All @@ -32,8 +106,6 @@ public partial class DependencyManager

internal void Init( BuildTarget platform, bool deepInit = true )
{
helpIconContent = null;
betaContent = null;
installedAny = false;
for (int i = 0; i < simple.Length; i++)
simple[i].Reset();
Expand Down Expand Up @@ -81,42 +153,43 @@ internal void Init( BuildTarget platform, bool deepInit = true )
firebaseDeepLinksExist = Utils.IsFirebaseServiceExist( "dynamic" );
}

private void OnHeaderGUI()
{
EditorGUILayout.BeginHorizontal();
GUILayout.Space( 25 );
GUILayout.Label( "Dependency", EditorStyles.largeLabel );
GUILayout.Label( "Current", EditorStyles.largeLabel, columnWidth );
GUILayout.Label( "Latest", EditorStyles.largeLabel, columnWidth );
GUILayout.Label( "Action", EditorStyles.largeLabel, columnWidth );
EditorGUILayout.EndHorizontal();
}

internal void OnGUI( BuildTarget platform )
{
if (helpIconContent == null)
helpIconContent = EditorGUIUtility.IconContent( "_Help" );
if (betaContent == null)
betaContent = new GUIContent( "beta", "Dependencies in closed beta and available upon invite only. " +
"If you would like to be considered for the beta, please contact Support." );
if (!installedAny)
EditorGUILayout.HelpBox( "Dependencies of native SDK were not found. " +
"Please use the following options to integrate solutions or any SDK separately.",
MessageType.Warning );

columnWidth = GUILayout.MaxWidth( EditorGUIUtility.currentViewWidth * 0.15f );
nameColumnWidth = GUILayout.MaxWidth( EditorGUIUtility.currentViewWidth * 0.32f );
EditorGUILayout.BeginHorizontal();
GUILayout.Space( 25 );
GUILayout.Label( "Dependency", EditorStyles.largeLabel, nameColumnWidth );
GUILayout.Label( "Current", EditorStyles.largeLabel, columnWidth );
GUILayout.Label( "Latest", EditorStyles.largeLabel, columnWidth );
GUILayout.Label( "Action", EditorStyles.largeLabel, columnWidth );
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();

if (simple.Length > 0)
{
solutionsFoldout = GUILayout.Toggle( solutionsFoldout, "Solutions", EditorStyles.toolbarButton );
HelpStyles.BeginBoxScope();
solutionsFoldout = GUILayout.Toggle( solutionsFoldout, "Solutions", EditorStyles.foldout );
if (solutionsFoldout)
{
OnHeaderGUI();
for (int i = 0; i < simple.Length; i++)
simple[i].OnGUI( this, platform );
}
HelpStyles.EndBoxScope();
}

if (advanced.Length > 0)
{
advancedFoldout = GUILayout.Toggle( advancedFoldout, "Advanced Integration", EditorStyles.toolbarButton );
HelpStyles.BeginBoxScope();
advancedFoldout = GUILayout.Toggle( advancedFoldout, "Advanced Integration", EditorStyles.foldout );
if (!advancedFoldout)
{
for (int i = 0; i < advanced.Length; i++)
Expand All @@ -134,18 +207,22 @@ internal void OnGUI( BuildTarget platform )
}
if (advancedFoldout)
{
OnHeaderGUI();
for (int i = 0; i < advanced.Length; i++)
advanced[i].OnGUI( this, platform );
}
HelpStyles.EndBoxScope();
}
if (other.Count > 0)
{
otherFoldout = GUILayout.Toggle( otherFoldout, "Other Active Dependencies: " + other.Count, EditorStyles.toolbarButton );
HelpStyles.BeginBoxScope();
otherFoldout = GUILayout.Toggle( otherFoldout, "Other Active Dependencies: " + other.Count, EditorStyles.foldout );
if (otherFoldout)
{
for (int i = 0; i < other.Count; i++)
other[i].OnGUI( this );
}
HelpStyles.EndBoxScope();
}

EditorGUILayout.HelpBox( "Please provide us with a list of integrated dependencies " +
Expand All @@ -164,11 +241,6 @@ internal void OnGUI( BuildTarget platform )
}
EditorGUILayout.EndHorizontal();
}
else if (platform == BuildTarget.iOS && !firebaseDeepLinksExist)
{
EditorGUILayout.HelpBox( "CAS Cross-promotion uses deep links to track conversions. " +
"Please add Firebase Deep Link dependency to the project.", MessageType.Warning );
}
}

internal void SetAudience( Audience audience )
Expand Down Expand Up @@ -278,22 +350,14 @@ internal void OnGUI( DependencyManager mediation, BuildTarget platform )
EditorGUILayout.BeginHorizontal();
bool installed = !string.IsNullOrEmpty( installedVersion );
if (( inBan && installed ) || ( installed && locked ) || ( isRequired && !locked && !installed ))
GUILayout.Label( EditorGUIUtility.IconContent( "d_console.erroricon.sml" ), GUILayout.Width( 20 ) );
GUILayout.Label( HelpStyles.errorIconContent, GUILayout.Width( 20 ) );
else if (string.IsNullOrEmpty( url ))
GUILayout.Space( 25 );
else if (GUILayout.Button( mediation.helpIconContent, EditorStyles.label, GUILayout.Width( 20 ) ))
else if (GUILayout.Button( HelpStyles.helpIconContent, EditorStyles.label, GUILayout.Width( 20 ) ))
Application.OpenURL( url );

if (beta)
{
GUILayout.Label( name, GUILayout.ExpandWidth( false ) );
GUILayout.Label( mediation.betaContent, "AssetLabel", GUILayout.ExpandWidth( false ) );
GUILayout.FlexibleSpace();
}
else
{
GUILayout.Label( name );
}
HelpStyles.OnLabelGUI( labels );
GUILayout.Label( name );

if (installed)
{
Expand Down
Loading

0 comments on commit 6611770

Please sign in to comment.