3
votes

I got a path that looks like this:

/private/var/mobile/Containers/Shared/AppGroup/D4A4F193-4125-406F-9A85-2B301F233D7E/image0.jpg

However when I check for existence (file.exists) it always returns false.

The full path I try to open is the same as before but adding file:// before it, so it ends up like this:

file:///private/var/mobile/Containers/Shared/AppGroup/D4A4F193-4125-406F-9A85-2B301F233D7E/image0.jpg

When doing app extensions apparently the file is shared in that folder. Tried File.applicationDirectory, File.documentsDirectory and File.storageDirectory, is there any other special place or way to retrieve the file?

1
I believe File.applicationDirectory, File.documentsDirectory and File.storageDirectory are the only places you will able to access with your app. Check the values of them to see where they point to. If your path is not within these directories i doubt it will possible to check for the file existencePhilarmon

1 Answers

2
votes

In the end what I forgot to add was the correct entitlements to my app descriptor, allowing me to access the AppGroup folder.

The whole process is detailed here:

http://easynativeextensions.com/sharing-files-between-an-air-app-and-an-ios-extension/#step_3