Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
}
```

Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AppTrackingTransparencySettings>(File.ReadAllText(SettingsFilePath));
Expand Down