realtime-swift icon indicating copy to clipboard operation
realtime-swift copied to clipboard

Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server."

Open danhdevelop opened this issue 1 year ago • 2 comments

Loop receiving NSURLErrorDomain error

Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server."

I am following the ReadMe.md and trying to init realtime connection, but only receive error as above. I checked the source code and look like there is no place to attach access_token to the connection. I believe that is the main reason of the error ( but not really sure yet)

To Reproduce

  1. Create an iOS sample project with Xcode
  2. Add package supabase realtime-swift
  3. Follow their ReadMe.md to declare the client instance and try to init the connection.

Screenshots

image

System information

  • Version of supabase realtime-swift: 0.0.2

danhdevelop avatar Apr 14 '23 15:04 danhdevelop

I am having the same issue, were you able to figure this out?

malachif-jpg avatar Jun 23 '23 03:06 malachif-jpg

I ran into this issue when I incorrectly forgot to add the realtime/v1/ to the endpoint parameter. From the logs you posted, it seems that you put /auth/v1 rather than realtime/v1

does NOT work:
RealtimeClient(endpoint: "http://myprojectname.supabase.co/")

works:
RealtimeClient(endpoint: "http://myprojectname.supabase.co/realtime/v1")

kurtguenther avatar Jul 08 '23 14:07 kurtguenther