My Realm Database would not always integrate with my app builds, especially on the first run, either on Device or Simulator. Apple rejected my app for this reason #277
//I have placed this code in app delegate
func openRealm() {
let initialURL = Bundle.main.url(forResource: "default", withExtension: "realm")!
let defaultURL = Realm.Configuration.defaultConfiguration.fileURL!
if Realm.Configuration.defaultConfiguration.schemaVersion == 0 {
do {
try FileManager.default.removeItem(at: defaultURL)
try FileManager.default.copyItem(at: initialURL, to: defaultURL)
} catch {
// Handle error here
print("realm delete copy error!!")
}
}
}
Version of Realm and Tooling
Realm Object Server Version: ?
Flavor:
[ ] Developer
[ ] Professional
[ ] Enterprise
Server OS & Version: ? (e.g. CentOS 6)
Client SDK Version: ?
Client OS & Version: ?
Logs
systemctl status realm-object-server.service
Paste output here
sudo journalctl -u realm-object-server.service
Paste output here
cat /var/log/realm-object-server.log
Paste output here
@adisain This appears to be an issue with the iOS SDK. Please report that in the https://github.com/realm/realm-cocoa repo and fill in all the details. Especially version and how to reproduce.
Thanks!
Goals
Expected Results
Actual Results
Steps to Reproduce
Code Sample
//I have placed this code in app delegate func openRealm() {
Version of Realm and Tooling
Logs
systemctl status realm-object-server.service
Paste output here
sudo journalctl -u realm-object-server.service
Paste output here
cat /var/log/realm-object-server.log
Paste output here