Black N WhiteB
Convex Community11mo ago
1 reply
Black N White

SwiftUI with Convex and Clerk problem :

in my app, I'm integrating Convex with Clerk auth, in my swiftUI ios app.

Before signing in, I have no problems talking to the Convex Backend.

I did all the steps. When I sign in, I print the auth state in the xcode logs, which says authenticated - with the JWT.

But after that, whenever I try to call a convex function, eg:
convex.client.subscribe(to: "profiles:getAll", yielding: [ProfileResult].self)
            .sink(receiveCompletion: { completion in
                if case .failure(let error) = completion {
                    print("Profiles subscription error: \(error)")
                }
            }, receiveValue: { [weak self] result in
                self?.profiles = result.map { Profile(fromResult: $0) }
                if self?.activeProfileID == nil && !result.isEmpty {
                    self?.activeProfileID = self?.profiles.first?.id
                }
            })
            .store(in: &cancellables)



the process stops there. I don't get any logs in Convex. I don't get the xcode console log of "Profiles subscription error: (error)".

I also cannot call any other mutations or subscribe to a query. I did a simple testQuery :
import { query } from "./_generated/server";

export const testQuery = query({
  handler: async (ctx) => {
    return ["Test succeeded"];
  },
});



That doesn't work either. Nothing is reaching client to Convex, nor Convex to Client.
Was this page helpful?