Problem with Full sync ToDo App


#1

I implemented code for Full sync ToDo App as mentioned in documentation ,

I logged in One device and Provided some user name and added some tasks
Now i ran same app in second device and logged in with same user name as logged in first device

So as user is logged in with same user name , So in second device we should get same tasks list as i created in first device.

But its not getting . So what could be the issue.


(jay) #2

We would probably need to see your code but the first question is: Using Realm Studio, did you connect to your Realm Cloud and verify the data was there?


#3

@jay

Yes , i connected to Realm cloud and verified also.Data was there.

And my code is same as mentioned in (From below document every thing i copied as it is)
https://docs.realm.io/sync/getting-started-1/ios-quick-start/step-1-my-first-realm-app


(jay) #4

Ok. A few things.

If you are using the current version of Realm (3.18.0) that code will not work as the authentication method used in the guide (nickname) has been changed and depreciated. So can you verify how you are authenticating?

The rest of the code pretty much works and I have built a couple of projects around it.

On the second device… when you use that device and create items, are they showing up in the app on that device? Do that also appear in Realm Studio? If so, where?


#5

@jay

First of all thanks for your reply.

First thing as you asked —> I am authenticating as mentioned below,

let creds = SyncCredentials.nickname(“sally”)

Second thing --> When i am creating some tasks then that tasks are showing in device but not showing in Realm Studio. In studio it is showing only Use Provider ID , User ID, Role , Status.

Advance info --> If i logout and login on same device then previous task list is showing in same device.


(jay) #6

That kinda indicates the app is writing data locally and only sync’ing upon app restart. My guess is there’s an issue with the sync’ing code since it appears to sync when you first start the app. It may be how Realm is being written to. It could also be an older version of Realm. Ensure you are using 3.18.0. You can easily update your project with the cocoapods.app. After you update, clean your build folder.

If updating it doesn’t fix the issue, include the code you’re using to connect to Realm