Hello NewYear's people.
I need to access a plist inside an app's group container.
To gain access in the sandboxed system what should I do to get it right. I did read then answer at Create directory in app group container swift but can't find the corresponding entitlement settings in XCode 11.
Is there a corresponding URL or path (String) function to get called? So far as I can see there is no .groupContainerDirectory option available.
Now I try to use the following code...
let appIdentifier = "UBF8T346G9.Office"
let fileManager = FileManager.default
let container = fileManager.containerURL(forSecurityApplicationGroupIdentifier: appIdentifier)
print("Container \(container)")
do{
if let container = container {
let directoryPath = container.appendingPathComponent("Profile Settings")
var isDir : ObjCBool = false
let path = directoryPath.path
if fileManager.fileExists(atPath: path, isDirectory: &isDir) {
if isDir.boolValue {
print("file exists and is a directory")
let plistPath = url.appendingPathComponent( "com.microsoft.visualbasic.plist").path
let plistDict = NSDictionary(contentsOfFile: plistPath)
if let dict = plistDict {
print("Dict: \(dict)") // <<<<<< Never comes here
}
}
}
}
} catch let error as NSError {
print(error.description)
}
}
is of course not working because I need some access app's their "group container"
Thank you.