The SwiftUI template todo app is unable to maintain a connection with MongoDB. The app itself works just fine, but it is unable to sync. The steps I’m taking are:
Create a new app and download zip file that contains the template SwiftUI app from Atlas App Services
Ensure appId and appUrl are correct in atlasConfig.plist
Build and launch app on iPhone 14 Pro simulator
Create a user via app and log in to the app
Create todo items
I can see the created user in App Services, but no todos are ever synced. Opening the app on a different simulator confirms that there is no syncing happening. The following is output when the app launches and attempts to connect to flexible sync (I’ve removed some identifying info from these logs):
Sync: Realm sync client ([realm-core-13.10.1])
Sync: Connection[1]: Session[1]: Binding '[obfuscatedpath]/flx_sync_default.realm' to ''
Sync: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, client reset = false
Sync: Connected to endpoint 'x.xx.xxx.xx:xxx' (from 'xxx.xxx.x.xx:xxxxx')
Sync: Connection[1]: Closing the websocket with status='SystemError: invalid certificate chain', was_clean='false'
Sync: Connection[1]: Connection closed due to error
If you’re using Realm, I would suggest going through the SwiftUI Getting Started guide and the following the instructions in the Add Sync section as those have been thoroughly vetted.
I am a bit unsure if that’s a correct step - where are you seeing those instructions?
Thanks Jay, I’ll give it the Getting Started guide a shot.
Those instructions are in the README of the template app, see here:
The template app actually downloads with the correct values set in the plist file, so this step was just confirming the values are correct; I didn’t actually have to change anything.
Then, log into the console, navigate to your app, scroll to to Logs and then View All Log Activity and see if there are any message or errors indicated there.