Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Str4tos committed Jan 12, 2022
1 parent 0a3aff1 commit 7fa6069
Show file tree
Hide file tree
Showing 21 changed files with 856 additions and 426 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Clever Ads Solutions Unity Plugin Change Log

## [2.0.0] - 2022-01-12
### Dependencies
- CleverAdsSolutions - [2.6.1](https://github.com/cleveradssolutions/CAS-Unity/releases)
### Features
- Updated user interface prefabes.
- AppTrackingTransparency and NSLocationTrackingDescription implementation migrated to CAS Unity plguin.
- Addded AppTrackingTransparency request in any case.

## [1.2.7] - 2021-09-07
### Dependencies
- CleverAdsSolutions - [2.5.2](https://github.com/cleveradssolutions/CAS-Unity/releases)
Expand Down
85 changes: 41 additions & 44 deletions Editor/ConsentRequestParametersEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class ConsentRequestParametersEditor : Editor
private SerializedProperty settingsTogglePrefabProp;
private SerializedProperty privacyPolicyUrlProp;
private SerializedProperty termsOfUseUrlProp;
private SerializedProperty trackingUsageDescriptionProp;

private ReorderableList privacyPolicyList;
private ReorderableList termsOfUseList;
Expand All @@ -55,7 +54,6 @@ private void OnEnable()
settingsTogglePrefabProp = props.FindProperty( "settingsTogglePrefab" );
privacyPolicyUrlProp = props.FindProperty( "privacyPolicyUrl" );
termsOfUseUrlProp = props.FindProperty( "termsOfUseUrl" );
trackingUsageDescriptionProp = props.FindProperty( "trackingUsageDescription" );

privacyPolicyList = new ReorderableList( props, privacyPolicyUrlProp, true, true, true, true )
{
Expand Down Expand Up @@ -93,59 +91,57 @@ public override void OnInspectorGUI()
var obj = serializedObject;
obj.UpdateIfRequiredOrScript();

EditorGUILayout.PropertyField( withAudienceDefinitionProp );
EditorGUILayout.PropertyField( withDeclineOptionProp );
EditorGUILayout.PropertyField( showInEditorProp );
EditorGUILayout.Space();

currentListProp = privacyPolicyUrlProp;
privacyPolicyList.DoLayoutList();
currentListProp = termsOfUseUrlProp;
termsOfUseList.DoLayoutList();
EditorGUILayout.Space();
showInEditorProp.boolValue = GUILayout.Toggle(
showInEditorProp.boolValue,
" Test in Unity Editor" );
withAudienceDefinitionProp.boolValue = GUILayout.Toggle(
withAudienceDefinitionProp.boolValue,
" With Age of audience requeset" );
EditorGUI.indentLevel++;
EditorGUILayout.HelpBox( "The user is prompted for the year of birth and the audience is determined automatically.", MessageType.None );
EditorGUI.indentLevel--;
withRequestTrackingTransparencyProp.boolValue = GUILayout.Toggle(
withRequestTrackingTransparencyProp.boolValue,
" With iOS App Tracking Transparency requeset" );
EditorGUI.indentLevel++;
EditorGUILayout.HelpBox( "The iOS 14.5+ users is prompted for permission to track the Advertising ID.", MessageType.None );
EditorGUI.indentLevel--;
withDeclineOptionProp.boolValue = GUILayout.Toggle(
withDeclineOptionProp.boolValue,
" With option of Decline consent" );
EditorGUI.indentLevel++;
EditorGUILayout.HelpBox( "The user is given the choice to opt out dialog.", MessageType.None );
EditorGUI.indentLevel--;

DrawPrefabSelector( "Consent UI Prefab",
uiPrefabProp, templateUIPrefabName, customUIPrefabName,
typeof( UserConsentUI ) );

HelpStyles.BeginBoxScope();
bool enableTogglePrefab = withMediationSettingsProp.boolValue;
if (enableTogglePrefab != EditorGUILayout.ToggleLeft( "With Mediaiton Settings", enableTogglePrefab ))
if (enableTogglePrefab != EditorGUILayout.ToggleLeft( "With Mediaiton Networks settings", enableTogglePrefab ))
{
enableTogglePrefab = !enableTogglePrefab;
withMediationSettingsProp.boolValue = enableTogglePrefab;
}
EditorGUI.BeginDisabledGroup( !enableTogglePrefab );
DrawPrefabSelector( "Toggle UI Prefab",
DrawPrefabSelector( "Network UI Prefab",
settingsTogglePrefabProp, templateSettingsPrefabName, customSettingsPrefabName,
typeof( MediationPolicyUI ) );
EditorGUI.EndDisabledGroup();
if (!enableTogglePrefab)
settingsTogglePrefabProp.objectReferenceValue = null;
HelpStyles.EndBoxScope();
EditorGUI.indentLevel++;
EditorGUILayout.HelpBox( "The user is provided with advanced consent settings for each active network in the game.", MessageType.None );
EditorGUI.indentLevel--;

HelpStyles.BeginBoxScope();
var activeTracking = withRequestTrackingTransparencyProp.boolValue;
if (activeTracking != GUILayout.Toggle( activeTracking,
"With iOS App Tracking Transparency requeset" ))
{
activeTracking = !activeTracking;
withRequestTrackingTransparencyProp.boolValue = activeTracking;
}
EditorGUI.BeginDisabledGroup( !activeTracking );
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField( "Tracking Usage Description:" );
if (GUILayout.Button( "Default", EditorStyles.miniButton, GUILayout.ExpandWidth( false ) ))
trackingUsageDescriptionProp.stringValue = locationUsageDefaultDescription;
if (GUILayout.Button( "Info", EditorStyles.miniButton, GUILayout.ExpandWidth( false ) ))
Application.OpenURL( configuringPrivacyURL );
EditorGUILayout.EndHorizontal();
trackingUsageDescriptionProp.stringValue =
EditorGUILayout.TextArea( trackingUsageDescriptionProp.stringValue, HelpStyles.wordWrapTextAred );
EditorGUILayout.HelpBox( "NSUserTrackingUsageDescription key with a custom message describing your usage location tracking to AppTrackingTransparency.Request().", MessageType.None );
EditorGUI.EndDisabledGroup();
HelpStyles.EndBoxScope();
EditorGUILayout.Space();
DrawPrefabSelector( "Consent UI Prefab",
uiPrefabProp, templateUIPrefabName, customUIPrefabName,
typeof( UserConsentUI ) );
EditorGUILayout.Space();

currentListProp = privacyPolicyUrlProp;
privacyPolicyList.DoLayoutList();
currentListProp = termsOfUseUrlProp;
termsOfUseList.DoLayoutList();

EditorGUILayout.HelpBox( "Use 'Edit > Clear All PlayerPrefs' menu to reset consent state in Unity Editor.", MessageType.Info );
obj.ApplyModifiedProperties();
}

Expand All @@ -154,10 +150,10 @@ private void DrawURLElement( Rect rect, int index, bool isActive, bool isFocused
var height = rect.height;
var item = currentListProp.GetArrayElementAtIndex( index );
rect.yMin += 1;
rect.yMax -= 1;
rect.yMax -= 3;
if (currentListProp.arraySize > 1)
{
rect.yMax -= height * 0.5f + 2;
rect.yMax -= height * 0.5f;

var id = item.FindPropertyRelative( "id" );
var label = ( index == 0 ? "Preferred " : "Platform " );
Expand Down Expand Up @@ -198,9 +194,10 @@ private void DrawPrefabSelector( string title, SerializedProperty prop, string t
prop.objectReferenceValue = LoadUITemplatePrefab( templateName );
}
EditorGUILayout.EndHorizontal();
EditorGUI.indentLevel++;
prop.objectReferenceValue =
EditorGUILayout.ObjectField( prop.objectReferenceValue, objType, false );
EditorGUILayout.Space();
EditorGUI.indentLevel--;
}

#region Utils
Expand Down
29 changes: 0 additions & 29 deletions Editor/PostprocessiOSBuild.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Editor/PostprocessiOSBuild.cs.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Plugins.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Plugins/iOS.meta

This file was deleted.

28 changes: 0 additions & 28 deletions Plugins/iOS/CASUAppTracking.m

This file was deleted.

39 changes: 0 additions & 39 deletions Plugins/iOS/CASUAppTracking.m.meta

This file was deleted.

Loading

0 comments on commit 7fa6069

Please sign in to comment.