Ver código fonte

move application group id string to a constant

cyberta 5 anos atrás
pai
commit
9fa8a2a768
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      deltachat-ios/Helper/DatabaseHelper.swift

+ 6 - 2
deltachat-ios/Helper/DatabaseHelper.swift

@@ -1,8 +1,12 @@
 import Foundation
 class DatabaseHelper {
 
+    /// The application group identifier defines a group of apps or extensions that have access to a shared container.
+    /// The ID is created in the apple developer portal and can be changed there.
+    static let applicationGroupIdentifier = "group.eu.merlinux.group.chat.delta.ios"
+
     var sharedDbFile: String {
-        guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.eu.merlinux.group.chat.delta.ios") else {
+        guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: DatabaseHelper.applicationGroupIdentifier) else {
             return ""
         }
         let storeURL = fileContainer.appendingPathComponent("messenger.db")
@@ -14,7 +18,7 @@ class DatabaseHelper {
     }
 
     var sharedDbBlobsDir: String {
-        guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.eu.merlinux.group.chat.delta.ios") else {
+        guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: DatabaseHelper.applicationGroupIdentifier) else {
             return ""
         }
         return fileContainer.appendingPathComponent("messenger.db-blobs").path