supabase / supabase-swift

A Swift client for Supabase

Home Page:https://supabase.com/docs/reference/swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Could not connect to the server" using Supabase in AppClip.

otymartin opened this issue · comments

commented

Describe the bug

I tried to fetch an object from my database in my AppClip but I keep getting a network error "Could not connect to the server"
The same fetch method works perfectly fine in my full app. I've had this problem before with Firebase so the solution was to use cloud functions instead to fetch objects in my appclip. So I wrote an Edge function to do the job, the same edge function works in my full app but fails in my app clip.

To Reproduce

  1. Create an app clip in your xcode project
  2. Fetch any object from your database using the client side sdk methods in the app clip (It will fail)
  3. Fetch the same object by invoking an edge function in your app clip (It will fail)
  4. But both will work in your full app.

Error Message

Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, NSUnderlyingError=0x301ec8000 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, uses wifi, _kCFStreamErrorCodeKey=65, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <6E5F83CB-4AC2-4597-AD9C-A2D80E1CB556>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <6E5F83CB-4AC2-4597-AD9C-A2D80E1CB556>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://[DATABASE ID].supabase.co/functions/v1/invite, NSErrorFailingURLKey=https://[DATABASE ID].supabase.co/functions/v1/invite, _kCFStreamErrorDomainKey=1}

System information

  • OS: iOS 17 Supabase 2.8.5, Xcode 15.4
commented

Its working now, and I have no clue why.