We’re at the tail end of re-writing a legacy Cordova app completely in a new Swift app, the issue we’re facing is when it comes to migration, the Cordova app stores some information on device like refresh tokens and when we force upgrade our users to the new app we want to keep them logged in.
The Cordova app is using a library called LokiJS to do this, and the sql lite db it stores this information in lives inside the /var/mobile/Containers/Data/Application/{UUID}/Library/NoCloud/
directory.
The new Swift app will be using the same bundle identifier so we SHOULD be able to access this directory, although so far I can’t find a way to access this.
There is no directory for /Library/NoCloud within SearchPathDirectory
for FileManager
, if we use the .libraryDirectory
and append "NoCloud" to it we get: "The folder “NoCloud” doesn’t exist."
Or even listing the subpathsOfDirectory for .libraryDirectory we get: "The file “Library” couldn’t be opened because there is no such file."
The UUID of the app also changes on every install, so no way to know the original full path.
Has anyone had experience doing this before? There must be a way as the Cordova App can read/write to it, but I can’t seem to find any concrete solution and it’s super important that we achieve this, it’s worth noting that our Android app CAN access this Loki db.