I’m following the getting Tasks app tutorials. Each time I quit the tasks app and restart it. The list is populated with tasks, but syncing does not work. Sync only works the first time the app runs. In order to get it working again, I have to delete the app from my device and relaunch it. As long as the app is running for the first time sync works. Any ideas?
We need to know what platform you’re using, how your authentication is set up (and the code) and then how you’re connecting to Realm (code). So we really need to see some code.
After some trial and error I discovered this to be specific to my iPhone. Since it was not occurring in the iOS simulator or on another iOS device I tired.
I’m using iOS 13.5.1 and Xcode 11.5 (11E608c)
The code was direct from the tutorial.
I was able to rectify the problem by deleting the tutorial task app from the iPhone, restarting the iPhone then reinstalling the task app. It appears to be working normally now.
Hi, I am using the Realm SDK for Unity and getting the same Error:
‘’’
Error: Websocket: Expected HTTP response 101 Switching Protocols, but received:
HTTP/1.1 404 Not Found
‘’’
This is how I am trying to connect to the application:
‘’’
async void OnEnable(){
var app = App.Create("My-Realm-App-Id");
var user = app.CurrentUser;
if(user == null){
user = await app.LogInAsync(Credentials.Anonymous());
var syncConfig = new FlexibleSyncConfiguration(app.CurrentUser);
_realm0 = await Realm.GetInstanceAsync(syncConfig);
}else{
var syncConfig = new FlexibleSyncConfiguration(app.CurrentUser);
_realm0 = Realm.GetInstance(syncConfig);
}
_realm0.Subscriptions.Update(() =>
{
_realm0.Subscriptions.Add(_realm0.All<Usuarios_data>(),new SubscriptionOptions {Name = "RegistrarSubscription"});
});
‘’’
I have already checked that I have set the permissions and enabled Anonymous Authentication, so I do not know what can be failing.
Thanks
let ra = RealmSwift.App(id: "foody23realm-jfsbk")
let realmUserKey = *** not showing API key in public post *** // DevUser23 API key
let credentials = Credentials.userAPIKey(realmUserKey)
do {
let thisUser = try await ra.login(credentials: credentials)
var loginConfiguration = thisUser.configuration(partitionValue: uuidFamily, clientResetMode: .discardUnsyncedChanges()) /// uuidFamily is a UUID value I would prefer not to publish in a public post
loginConfiguration.objectTypes = [Categories.self,
Commodities.self,
Units.self,
Stores.self,
Accounts.self,
ShoppingItems.self
Ledgers.self,
Journals.self,
Vehicles.self,
Packages.self]
let realm = try await Realm(configuration: loginConfiguration, downloadBeforeOpen: .always)
} catch {
fatalError("WARNING: Can't run without database access; \(devDate.timeIntervalSinceNow)")
}