Hi All,
I have enabled the UIFileSharingEnabled in the app, because I gave the download option to the pdf & excel files to store into iPhone & iPad Files
I am using Realm to store the data offline, here unwanted realm auxiliary files are downloaded to iPhone & iPad files that are giving issues to iOS14 - 14.4, when I open files in higher version iOS14 - 14.4 activity indicator loading in files its never opening the files. The files not crash but not opening.
i using code below.
let paths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,
.userDomainMask,
true)
let oldPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let applicationSupportDirectoryPath = paths.first
let realmPath = applicationSupportDirectoryPath?.appending("ofline.realm")
Realm.Configuration.defaultConfiguration.objectTypes = objectTypes
var realmConfig = Realm.Configuration.defaultConfiguration
realmConfig.fileURL = URL(fileURLWithPath: realmPath!)
realm = try! Realm(configuration: realmConfig)
do{
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm"))
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm.lock"))
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm.management"))
}
catch{
}
but i can't delete the default .realm.lock, default.realm.management, default.realm files. please help me.
I have enabled the UIFileSharingEnabled in the app, because I gave the download option to the pdf & excel files to store into iPhone & iPad Files
I am using Realm to store the data offline, here unwanted realm auxiliary files are downloaded to iPhone & iPad files that are giving issues to iOS14 - 14.4, when I open files in higher version iOS14 - 14.4 activity indicator loading in files its never opening the files. The files not crash but not opening.
i using code below.
let paths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,
.userDomainMask,
true)
let oldPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let applicationSupportDirectoryPath = paths.first
let realmPath = applicationSupportDirectoryPath?.appending("ofline.realm")
Realm.Configuration.defaultConfiguration.objectTypes = objectTypes
var realmConfig = Realm.Configuration.defaultConfiguration
realmConfig.fileURL = URL(fileURLWithPath: realmPath!)
realm = try! Realm(configuration: realmConfig)
do{
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm"))
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm.lock"))
try FileManager.default.removeItem(atPath: oldPaths[0].appending("ofline.realm.management"))
}
catch{
}
but i can't delete the default .realm.lock, default.realm.management, default.realm files. please help me.