Realm auxiliary files downloading in iPhone/iPad files getting issues in iOS14

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.
finally i got the solution
  • Please update xcode 12.5

  • Please use pod 'RealmSwift', '~> 10.5.0'

  • This 10.5 version only support unrealm concept

  • If enable UIFileSharing Enabled the files opening even the realm auxiliary files downloading



I think you need to talk to Realm about this. Deleting files ‘behind the back’ of the database seems very risky, so you should ask their advice on how to position their database to avoid this conflict (and, if there’s a migration issue, move it from one place to another).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thanks for your valuable response.
its working ios13 but not woking ios14 if any restriction apple done for this?
Again, this is something you need to talk to Realm about.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Accepted Answer
finally i got the solution
  • Please update xcode 12.5

  • Please use pod 'RealmSwift', '~> 10.5.0'

  • This 10.5 version only support unrealm concept

  • If enable UIFileSharing Enabled the files opening even the realm auxiliary files downloading



Realm auxiliary files downloading in iPhone/iPad files getting issues in iOS14
 
 
Q