すべてのユーザー間で共有テーブルを管理する方法を作成しましたが、このテーブルは表示されません。私はちょうど "〜"文字を削除していますが、それは "〜"文字を残しても動作しますが、テーブルにはオーナーしか見ることができません。私はなぜそれが動作しないのか分からない。おそらく、ユーザー間でテーブルを共有するのは適切な方法ではないでしょうか?レルムオブジェクトサーバーのデータベースが表示されません
static public func setGlobalDatabase(database:String, completion: @escaping (_ realm: Realm?, _ error: Error?) -> Void) {
let realmPath = RealmService.REALM_SERVER_DATA + "/" + ConstanteService.APP_DOMAINE + "-" + database
let user = SyncUser.current
if user == nil {
SyncUser.logIn(with: .usernamePassword(username: RealmService.username, password: RealmService.password, register: false), server: URL(string: RealmService.REALM_SERVER_HTTP)!) { user, error in
guard let user = user else {
completion(nil, error)
return
}
DispatchQueue.main.async {
// Open Realm
let configuration = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: URL(string: realmPath)!))
let permission = SyncPermissionValue(realmPath: realmPath, // The remote Realm path on which to apply the changes
userID: "*", // The user ID for which these permission changes should be applied
accessLevel: .write) // The access level to be granted
user.applyPermission(permission) { error in
if let error = error {
// handle error
return
}
// permission was successfully applied
}
completion(try? Realm(configuration: configuration), nil)
}
}
}
else{
DispatchQueue.main.async {
// Open Realm
let configuration = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user!, realmURL: URL(string: realmPath)!))
completion(try? Realm(configuration: configuration), nil)
}
}
}