You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,3 +45,98 @@ Just add this line to the `Packages/manifest.json` file of your Unity Project:
45
45
1. Download the most recent Unity package release [here](https://github.com/lupidan/unity-apptrackingtransparency/releases)
46
46
2. Import the downloaded Unity package in your app.
47
47
48
+
49
+
## Plugin configuration
50
+
51
+
To access the plugin configuration just go to the menu present in **Assets -> AppTrackingTransparency -> Configuration** You should see a window like this:
52
+
53
+

54
+
55
+
### Editor manager status
56
+
In this section you can control the current status of the editor implementation for the plugin.
57
+
58
+
-*Authorization Status*: Current authorization status returned by the editor implementation
59
+
-*IDFA*: Current IDFA value returned by the editor implementation when the status is Authorized.
60
+
-*Random IDFA*: Generates a new random IDFA value
61
+
-*Reset status*: Completely reset the status of the editor implementation, simulating the status after a fresh app install.
62
+
63
+
### iOS Build settings
64
+
65
+
The plugin offers automated options for post-processing on iOS.
66
+
This section allow you to configure what parts of the automatic post-processing you want to have for your project.
67
+
-*Automatic postprocessing*: If enabled the automatic postprocessing for iOS will be run. If disabled, it will be completely ignored.
68
+
-*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.
69
+
-*Add AppTrackingTransparency.framework*: If enabled, the automatic post-processing will automatically add the AppTrackingTrasnparency.framework as optional for compatibility with previous iOS versions.
70
+
-*Add NSUserTrackingUsageDescription*: If enabled, the automatic post-processing will automatically add the required description to be displayed when requesting permission to the user.
71
+
-*Tracking Usage Description*: String of text to be added as NSUserTrackingUsageDescription so it's displayed to the user when requesting permission.
72
+
-*Auto-detect Info.plist file*: The NSUserTrackingUsageDescription value needs to be added to the main target's `Info.plist` file. When enabled, the auto post-processing will detect the current file and add the value in it. If disabled, you will have the option to specify the relative path for the `Info.plist` file you want to modify.
73
+
74
+
## Implementing the AppTrackingTransparency code
75
+
76
+
### Setup the manager
77
+
To setup the plugin, you need to:
78
+
1) Create the manager
79
+
2) Update it in an Update method or similar update loop.
80
+
81
+
You can create and update the component in a MonoBehaviour of your choice. The MonoBehaviour can be a dedicated one, just for this manager, or a MonoBehaviour containing other managers.
82
+
83
+
**Calling Update is required** if you want to receive any asynchronous callbacks to be handled correctly inside Unity's update loop.
84
+
85
+
```
86
+
using AppTrackingTransparency;
87
+
using AppTrackingTransparency.Common;
88
+
89
+
...
90
+
91
+
public AppTrackingTransparencyHandler : MonoBehaviour
92
+
{
93
+
public IAppTrackingTransparencyManager AppTrackingTransparencyManager;
Starting from iOS 14.5, if the status is Authorized, you should get the user's IDFA. Otherwise, you should get an anonymous IDFA (`00000000-0000-0000-0000-000000000000`)
122
+
In previous iOS versions you should get the user's IDFA.
123
+
```
124
+
this.AppTrackingTransparencyManager.Idfa;
125
+
```
126
+
127
+
### Request tracking authorization
128
+
You should request permission when the tracking authorization status is not determined.
129
+
> :warning: The callback won't execute if you are not calling Update on the AppTrackingTransparencyManager. **Make sure you are periodically calling Update on it**.
Debug.Log("Authorization status changed: " + authStatus);
135
+
});
136
+
```
137
+
138
+
## Any code samples?
139
+
There is a [folder](https://github.com/lupidan/unity-apptrackingtransparency/tree/main/com.lupidan.unity-apptrackingtransparency/Samples%7E) inside the plugin code containing some samples.
140
+
You can also import the sample code into your project by going to the Unity Package Manager, selecting the packages In Project, and selecting the AppTrackingTransparency for Unity package. You should see an option to import a sample:
0 commit comments