I am working through the realm swift tutorial found here.
Once I completed the tutorial successfully on my local machine I deployed the realm object server on a Ubuntu digital ocean server.
Now when I run the code on my dev machine pointing to the server I get the error message:
Connecting to endpoint '139.59.102.91:80' (1/1)
2017-02-20 20:29:27.576 RealmTasksTutorial[9998:243100] Sync: Connection[1]: Failed to connect to endpoint '139.59.102.91:80': Connection refused
The problem, might be, that when you work through the tutorial it gets you to start up their Mac app and create a task. Then you move to the next step and create the iOS app. In the iOS app, in the SetupRealm() they synch with the realm server with the following lines:
if self.items.realm == nil, let list = self.realm.objects(TaskList.self).first {
self.items = list.items
}
This will only populate self.items
if the realm server has that first task added (by the Mac app). So the tutorial works fine when all is run on my local machine.
The problem is when I deploy the realm object server to the digital ocean Ubuntu instance. There is no Mac app to populate that first task.
Is there a better way to check realm and initialize/populate self.items
?