realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

iOS app's Todo sample app's link is broken. App doesn't compile either #423

Closed zeeshanz closed 4 years ago

zeeshanz commented 5 years ago

On this Docs page:

https://docs.realm.io/sync/getting-started-1/ios-quick-start/step-2-adding-query-based-sync

The gitHub link is broken.

I managed to find the sample app code, but it doesn't compile.

bmunkholm commented 5 years ago

@zeeshanz Thanks for noting this! I've fixed the docs and will check the compile error.

ejm01 commented 5 years ago

@zeeshanz I was able to compile and run from a fresh clone with the instructions in the readme.

Which package manager are you using? Could you share the error you are receiving when you build?

zeeshanz commented 5 years ago

Thanks @ericjordanmossman for fixing the link.

I am using CocoaPods.

I just cloned it once again, compiled fine. I must have done something wrong the first time.

However trying to log in as a new user fails in the initializePermissions(user). I have figured out that I can make the user an Administrator by changing line 92 to let creds = SyncCredentials.nickname(textField.text!, isAdmin: true), login again with this admin user so that Realm is created, and then set it back to regular user, then the app works fine for subsequent users. However this doesn't reflect in the tutorial or the Readme file.

Screen Shot 2019-04-02 at 5 14 52 PM
ejm01 commented 5 years ago

Ah, I see. I think I know what's happened.

The initializePermissions method requires a realm to have been created with the schema properties that are being modified.

If you're using realm studio then you can create a realm at the path /default (or delete it then recreate) and upgrade it to a reference realm. This solved the issue for me immediately.

Though, of course I'm going to make this clear in the readME and other resources. I suspect this error flew under for a bit because the realm and schema will be created beforehand as part of the tutorial walkthrough.

zeeshanz commented 5 years ago

I figured this out while doing my learning. But for a started its a very frustrating roadblock. The Android version of the same app worked fine though and I didn't have any problems there.

ejm01 commented 5 years ago

Thanks for the feedback. We'll make the appropriate changes.

bmunkholm commented 5 years ago

@ericjordanmossman Was this fixed?

cbush commented 4 years ago

Built & ran from scratch. Seems to be resolved.