Help! Passing a file to iOS build.

Hi all. I’m finally building my game on iOS and I’m planning to do it on Android as well, but I’ve got a problem which doesn’t emerge if I play it in the editor.
_

My game is made of many level (one scene per level) and I need to have a file with information about each one of these levels. Up to now, I’ve used a pre-run editor-only script that open all levels added in the build settings one by one, check for objects, count them and save the results in a file saved in the Assets folder, which is then both read and written by the actual game.
In the editor works fine. However, if I build my project for iOS, the file is missing and my game has no information about levels. I’ve tried to save it in the Resources folder but it doesn’t work neither.
_
Should I use “Application.persistentDataPath”? But how can I pass my file to the build? I need it to be persistent over multiple versions of my game and I don’t want to generate this file on mobile devices.

I’ve found a working solution. I post it for the internet.

I generate the file with all information about levels in the Resources folder. Then, as the game starts, it searches for a local file in Application.persistentDataPath. If it doesn’t exist (i.e. first time playing) then the file is loaded brand new via Resources.Load() and used in the game. When the game saves for the first time it creates the file at Application.persistentDataPath. Easy.

gameDataPath = Application.persistentDataPath + "/gameData.txt";
    
if (File.Exists(gameDataPath))
       gameData = JsonUtility.FromJson<GameData>(File.ReadAllText(gameDataPath));
else
       gameData = JsonUtility.FromJson<GameData>(Resources.Load<TextAsset>("gameData").text);