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 99a6442..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" } ``` @@ -126,7 +126,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 plugin offers automated options for post-processing on iOS. 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. - *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. diff --git a/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs b/com.lupidan.unity-apptrackingtransparency/Editor/AppTrackingTransparencyEditorTools.cs index f02cc56..1c8d66f 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); @@ -118,14 +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(); - AppTrackingTransparencySettingsManager.LoadSettings(); + settings = AppTrackingTransparencySettingsManager.LoadSettings(); } + + AppTrackingTransparencySettingsManager.WriteSettings(settings); + 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));