Appwrite: 1.3.8
Apple SDK Version: 2.0.0
Implementation:
// After making sure that the user is signed in like:
let isLoggedIn = AppSdk.shared.isUserLoggedIn()
// where `isUserLoggedIn` is:
func isUserLogedIn() async -> Bool {
do {
_ = try await account.get()
return true
} catch {
return false
}
}
/// User is logged in here.
let realtime = Realtime(AppSdk.shared.client)
let _ = realtime.subscribe(channel: "account") { (response) in
print(String(describing: response))
}
Not only the account, but no events are delivered for any type of channel, example: documents.
I can successfully create a websocket connection via Postman for documents channel which is able to receive the response.
Url used in Postman: ws://192.168.1.7:1099/v1/realtime?project=projectID&channels[]=documents.
Also, there are no errors in the logcat so I believe the connection might be succesfull between the sdk and server but no data is received.
I'm not fluent in Swift so not sure what the issue is. This code looks correct based on the example code in docs.
Just to be sure all other appwrite emdpoints work in your app?
Yepp, account creation, sign in, pass recovery, etc work fine.
Closing this as it worked automatically after :
docker compose stop- Turn off
Docker Desktop - Turn off computer
- Take some break from work!
- Got back to work & reopened the project š
[SOLVED] Realtime connection not working
Recommended threads
- Sub-minute server-side execution for rea...
Hey ā I'm building a real-time auction app on Appwrite Cloud and running into a timing limitation I'd please love some clarity on. My use case: when a bidding ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...