From 865667c3a034f4658fef3b2545eb00fe7498123b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 14:51:13 +0200 Subject: [PATCH 1/6] Makes it so Load() returns default in-memory settings if the file is not present --- .../AppTrackingTransparencyEditorTools.cs | 3 +- .../AppTrackingTransparencySettingsManager.cs | 31 ++++++------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs b/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs index f02cc56..45d3d6a 100644 --- a/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs +++ b/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs @@ -77,7 +77,7 @@ private void OnGUI() GUILayout.Label("iOS Build Settings", EditorStyles.boldLabel); GUILayout.Space(10); - var settings = AppTrackingTransparencySettingsManager.LoadOrCreateSettings(); + var settings = AppTrackingTransparencySettingsManager.LoadSettings(); GUILayout.Label("Settings file v" + settings.SettingsFileVersion, EditorStyles.miniLabel); GUILayout.Label(AppTrackingTransparencySettingsManager.PrintableProjectSettingsFilePath, EditorStyles.miniLabel); @@ -124,7 +124,6 @@ private void OnGUI() if (GUILayout.Button("Reset to default", new [] {GUILayout.MaxWidth(150)})) { AppTrackingTransparencySettingsManager.DeleteSettings(); - AppTrackingTransparencySettingsManager.LoadSettings(); } EditorGUIUtility.labelWidth = labelWidth; } diff --git a/com.lupidan.unity-apptrackingtransparency/Editor/Settings/AppTrackingTransparencySettingsManager.cs b/com.lupidan.unity-apptrackingtransparency/Editor/Settings/AppTrackingTransparencySettingsManager.cs index b7b31a5..712a35e 100644 --- a/com.lupidan.unity-apptrackingtransparency/Editor/Settings/AppTrackingTransparencySettingsManager.cs +++ b/com.lupidan.unity-apptrackingtransparency/Editor/Settings/AppTrackingTransparencySettingsManager.cs @@ -24,31 +24,20 @@ public static class AppTrackingTransparencySettingsManager SettingsFolderPath, DedicatedSettingsFileName); - public static AppTrackingTransparencySettings LoadOrCreateSettings() - { - var settings = LoadSettings(); - if (settings == null) - { - settings = new AppTrackingTransparencySettings(); - settings.SettingsFileVersion = 1; - settings.AutomaticPostProcessing = true; - settings.AutomaticPostProcessingCallbackOrder = 10; - settings.AddAppTransparencyTrackingFramework = true; - settings.AddUserTrackingUsageDescription = true; - settings.UserTrackingUsageDescription = "Your data will be used to deliver personalized ads to you"; - settings.AutoDetectInfoPlistFilePath = true; - settings.MainInfoPlistFilePath = "Info.plist"; - WriteSettings(settings); - } - - return settings; - } - public static AppTrackingTransparencySettings LoadSettings() { if (!File.Exists(SettingsFilePath)) { - return null; + var defaultSettings = new AppTrackingTransparencySettings(); + defaultSettings.SettingsFileVersion = 1; + defaultSettings.AutomaticPostProcessing = true; + defaultSettings.AutomaticPostProcessingCallbackOrder = 10; + defaultSettings.AddAppTransparencyTrackingFramework = true; + defaultSettings.AddUserTrackingUsageDescription = true; + defaultSettings.UserTrackingUsageDescription = "Your data will be used to deliver personalized ads to you"; + defaultSettings.AutoDetectInfoPlistFilePath = true; + defaultSettings.MainInfoPlistFilePath = "Info.plist"; + return defaultSettings; } return JsonUtility.FromJson(File.ReadAllText(SettingsFilePath)); From 231c9442d7dfb7b9f74d17880d958fa70f1b267a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 15:00:48 +0200 Subject: [PATCH 2/6] Better handling of settings --- .../Editor/AppTrackingTransparencyEditorTools.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs b/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs index 45d3d6a..1c8d66f 100644 --- a/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs +++ b/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs @@ -118,13 +118,15 @@ private void OnGUI() GUILayout.Label("- " + GetUserTrackingUsageDescriptionHint(), EditorStyles.miniLabel); } - AppTrackingTransparencySettingsManager.WriteSettings(settings); - GUILayout.Space(10); if (GUILayout.Button("Reset to default", new [] {GUILayout.MaxWidth(150)})) { AppTrackingTransparencySettingsManager.DeleteSettings(); + settings = AppTrackingTransparencySettingsManager.LoadSettings(); } + + AppTrackingTransparencySettingsManager.WriteSettings(settings); + EditorGUIUtility.labelWidth = labelWidth; } } From c18ec251b2007f6d58fe74beb817226e6be16683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 15:10:02 +0200 Subject: [PATCH 3/6] Update README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 99a6442..5b90797 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,10 @@ In this section you can control the current status of the editor implementation ### iOS Build settings The plugin offers automated options for post-processing on iOS. +> The settings file is located in: +> "ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json" +> This is a file you will want to commit to your repository, to keep your plugin configuration. + This section allow you to configure what parts of the automatic post-processing you want to have for your project. - *Automatic postprocessing*: If enabled the automatic postprocessing for iOS will be run. If disabled, it will be completely ignored. - *Postprocessing Callback Order*: The order in which the postprocessing will be run. You can change the number so it works along other postprocessing scripts you may have in your project. The default value is 10. From 17a634307ff56c912c5274d01bb87e1d2316f404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 15:15:07 +0200 Subject: [PATCH 4/6] Updates README --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b90797..9061a21 100644 --- a/README.md +++ b/README.md @@ -127,9 +127,12 @@ In this section you can control the current status of the editor implementation ### iOS Build settings The plugin offers automated options for post-processing on iOS. -> The settings file is located in: -> "ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json" -> This is a file you will want to commit to your repository, to keep your plugin configuration. + +The first time you modify the iOS Build Settings, settings are saved in: + +`ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json"` + +> :warning: This is a file you will want to commit to your repository, to keep your plugin configuration saved. This section allow you to configure what parts of the automatic post-processing you want to have for your project. - *Automatic postprocessing*: If enabled the automatic postprocessing for iOS will be run. If disabled, it will be completely ignored. From 259e10411bed6d917e2f9b94b7bb6243210dc8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 15:16:21 +0200 Subject: [PATCH 5/6] Updates README --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9061a21..37f3283 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,9 @@ In this section you can control the current status of the editor implementation ### iOS Build settings -The plugin offers automated options for post-processing on iOS. +The plugin offers automated options for post-processing on iOS. The first time you modify the iOS Build Settings, settings are saved in: -The first time you modify the iOS Build Settings, settings are saved in: - -`ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json"` +`ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json` > :warning: This is a file you will want to commit to your repository, to keep your plugin configuration saved. From 76559c409d757fa1151dd2aec1e749571f59cb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupian=CC=83ez=20Casares?= Date: Sat, 6 Nov 2021 15:22:36 +0200 Subject: [PATCH 6/6] Updates CHANGELOG and README for new version --- CHANGELOG.md | 7 ++++++- README.md | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ff327e..d2e9668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.7.0] - 2021-11-06 +- Fixes bug when settings file is does not exist that prevented Postprocessing to be executed successfully +- Adds some info regarding the settings file created by the plugin + ## [0.6.0] - 2021-08-11 - Fixes **major** bug of the package not returning the actual status code. @@ -12,6 +16,7 @@ - Editor implementation for the feature, imitating the native implementation. - Configurable automatic postprocessing, add required frameworks and required Info.plist entries -[Unreleased]: https://github.com/lupidan/unity-apptrackingtransparency/compare/v0.6.0...HEAD +[Unreleased]: https://github.com/lupidan/unity-apptrackingtransparency/compare/v0.7.0...HEAD +[0.7.0]: https://github.com/lupidan/unity-apptrackingtransparency/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/lupidan/unity-apptrackingtransparency/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/lupidan/unity-apptrackingtransparency/releases/tag/v0.5.0 diff --git a/README.md b/README.md index 37f3283..1ff67ba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This plugin supports the following platforms: ## Installation -> Current version is v0.6.0 +> Current version is v0.7.0 Here is a list of available options to install the plugin @@ -37,7 +37,7 @@ Just add this line to the `Packages/manifest.json` file of your Unity Project: ```json "dependencies": { - "com.lupidan.unity-apptrackingtransparency": "https://github.com/lupidan/unity-apptrackingtransparency.git?path=/com.lupidan.unity-apptrackingtransparency#v0.6.0" + "com.lupidan.unity-apptrackingtransparency": "https://github.com/lupidan/unity-apptrackingtransparency.git?path=/com.lupidan.unity-apptrackingtransparency#v0.7.0" } ```