I got a problem with iOS devices and Unity Analytics. My app copys a file from StreamingAssets to the Documents folder on iOS devices, so the user can have acess to it. I set up the plist.info so the whole Documents folder appears for the user in Apple’s File Browser. Everything works and is fine, but Unity keeps creating the directories “Unity/xxxx/Analytics/…” (shown in the attached picture below). I totally turned off Analytics in Services, turned off Editor Analytics (I know it should have nothing to do with Services/Analytics, but still turned off). Even put this in a MonoBehaviour:
But still Unity creates the folders and files. In the automatically created config file also Analytics.enabled is set to true. What is wrong? If it’s not possible to completely turn off Analytics, maybe one can change its flush path? I just want that Unity stops creating files and folders in Documents on iOS
Like I said: I turned off the Analytics in the Services Window. Already created new builds, then deleted folders and files in Apple’s File Browser first, then deleted the App and then reinstalled the new builds. Still same behaviour!
EDIT: Oops, RDL-Bot and Boerdler are the same developer. Please don’t get confused why I replied with this account.
You mentioned that your app “copies a file” etc. Does is still occur on a new project (or on the same project) when you don’t do that and don’t modify the plist.info? Also, it does sound like Analytics is still enabled on the project. I trust your debug log statement shows as being executed? I would encourage you to confirm by using Charles Proxy also https://support.unity3d.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity .
I carried out your instructions. I noticed that the app is still executing an HTTP request at the very beginning. Then it doesn’t happen anymore. In the following picture you can see what was triggered:
For comparison I tested one of our apps with Analytics enabled. There are significantly more requests in a short time. See the following picture:
Apparently Analytics is not completely disabled. What else could I do?
The call that you see is checking to see if Analytics or any of the other Unity services are enabled, and it is not. We are not collecting/storing any data, it’s a read-only request.
Thanks for the reply. But how can I refuse Analytics from creating any files or folders in documents folder on iOS now? In my oppinion the created files and folders should not be in the Documents rather in Library.
I’m encountering exactly the same problem on iOS as Boerdler. One additional piece of information is that if you delete the Unity directory in Documents using the Files app, the directory immediately gets recreated when the Unity-based app gets foregrounded again. The file that gets created is called “values” and the contents are a bunch of empty tags as follows:
The app I’m currently developing also wants to expose the Documents folder to users on iOS, but faces similar issues.
I am using Analytics and IAP on Unity2018.4.
Can I know the following about this issue:
Where can I see the status of this issue?
Will it be supported by the policy of changing the location where Analytics creates files under the Library folder?
There currently is not a bug on this, please submit one and provide the ID. You might try disabling Analytics at runtime in the meantime. IAP requires Analytics during installation, but you can disable Analytics as mentioned at runtime. It is undetermined if this will stop the files from being written, but worth a test.
Thank you for your support.
I submitted a bug report about files and folders automatically created under the Documents folder.
Regarding the test you taught,
Analytics in the Services Window of UnityEditor remains ON (because IAP is turned off if it is turned off)
I added the following code and tried it on Unity2018.4.15f1 and Unity2019.2.17f1.
As a result, both versions created Unity folders and files under the Documents folder.
Also, in Unity2019.3.0f5, I tested with Ads (original unused), IAP, Analytics disabled, but the result was the same.
I tried the following code for CrashReporting, but I couldn’t disable it because of an error when building the iOS target.
Certainly I seem to be misunderstanding what CrashReporting is pointing to and how to disable it.
Is CrashReporting the CloudDiagnostics in the Services window?
In Unity2019.3.0f5, I turned off Ads, IAP, CloudDiagnostics, and Analytics and tried it.
Confirmed that the Documents/Unity folder and folders and files under it were not created immediately after the application started.
I want to publish files created by users to users themselves in the app I’m delivering, but I haven’t enabled the UISupportsDocumentBrowser setting because of this bug.
If it’s not likely to be fixed in the near future, I’m thinking of implementing a way to access user-created files in the app.
The version of Unity we use in our app is 2019.2.18f1, but if it’s already up to date and fixed, we’ll consider updating it.