Crazy paths problems on "local" storgare for IOS

273 views
Skip to first unread message

andrea antonello

unread,
Jul 29, 2019, 3:28:18 AM7/29/19
to Flutter Development (flutter-dev)
Hi developers, 
I am developing an app that allows the user to collect data in the field and save them into an sqlite database.
The user will create one db per project and survey and ideally he/she will need to access and share that database.

For that reason I added to the Info.plist teh keys:

    <key>LSSupportsOpeningDocumentsInPlace</key>
    <true/>
    <key>UIFileSharingEnabled</key>
    <true/>

and am using the path_provider to handle the documents folder with getApplicationDocumentsDirectory.

I come from Android and have very limited IOS experience, so my question might seem obvious, but here is what happens.

When I create the database, it is created properly inside:

/var/mobile/Containers/Data/Application/very_long_key_of_the_app_i_assume/Documents/appname/my_project.sqlite

and that is awesome and ok.

After a while (or if a close the app from the apps list), once I rerun the app, the database path magically got converted into:

/private/var/mobile/Containers/Data/Application/very_long_key_of_the_app_i_assume/Documents/tmp/appname-Inbox/my_project.sqlite

I am really puzzeled about the new path starting with private and ending in the tmp... Inbox folder.

Can anyone point me in the right documentation to understand what is going on?

Thank you,
Cheers,
Andrea

andrea antonello

unread,
Jan 3, 2020, 2:47:06 AM1/3/20
to Flutter Development (flutter-dev)
And only after half a year I found the answer in another post :-D

For those interested:


Long story short, it seems that IOS changes the execution root folder at each launch.

Cheers,
Andrea
Reply all
Reply to author
Forward
0 new messages