-2

I finished all the work and I can read the data normally in debug mode. But uploading to TestFlight I don't know where the downloaded data goes?

In debug mode, the data is in the Runner.app/OnDemandResources/com.xxx.FontsPack-xxxx.assetpack directory, but the TestFlight version does not have this directory, so I I can't read the data.

So where should I go to find the downloaded Tag resource file?

HangarRash
  • 7,314
  • 5
  • 5
  • 32
capdev
  • 257
  • 1
  • 7

1 Answers1

0

You may have missed the point of how on demand resources work. If you're somehow dumpster diving to find the downloaded resources in their real location, directly, you've been doing it wrong. You just ask, in your app code, for a resource as if it were present right in your app's main bundle. If the app is downloaded and made available for use by means of a bundle resources request, it will appear to be in the main bundle and this will work.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • And compare my https://stackoverflow.com/a/60555129/341994 – matt Jan 15 '23 at 04:13
  • Thank you very much for your answer, because I am developing with flutter and I just need to get the binary data of the downloaded file. Can you please tell me the easiest way to get the binary of that file? In the Xcode project, the file is in Runner/FontsPack/cz.zip and the Tag of the file is FontsPack, in case I have successfully downloaded the data, how can I already read the binary data of Runner/FontsPack/cz.zip? – capdev Jan 15 '23 at 04:57
  • let filePath = Bundle.main.path(forResource: "cz", ofType: "zip", inDirectory: "FontsPack"). But I got nil – capdev Jan 15 '23 at 05:38
  • Thank you, my problem has been solved. Just delete inDirectory: "FontsPack" and you're good to go! – capdev Jan 15 '23 at 13:12
  • Correct. And that is what my answer said. I said it was as if the resource were "present _right in your app's main bundle_." I said nothing about any imaginary folder inside the main bundle; I said it was in the main bundle plain and simple. – matt Jan 15 '23 at 13:53