S
Supabase3w ago
Ken

Swift SDK Crashes For New App

Hi all, I'm trying out Supabase for a MacOS app. Using version 2.5.1 (https://github.com/supabase/supabase-swift) and attempting to connect top my db, the app crashes immediately here: Here is my init :
let supabaseURL = "aws-0-us-east-1.pooler.supabase.com"
let supabaseKey = "sb_publishable_KEY"

client = SupabaseClient(
supabaseURL: URL(string: supabaseURL)!,
supabaseKey: supabaseKey,
options: .init(storage: .init())
)
let supabaseURL = "aws-0-us-east-1.pooler.supabase.com"
let supabaseKey = "sb_publishable_KEY"

client = SupabaseClient(
supabaseURL: URL(string: supabaseURL)!,
supabaseKey: supabaseKey,
options: .init(storage: .init())
)
let defaultStorageKey = "sb-\(supabaseURL.host!.split(separator: ".")[0])-auth-token"
let defaultStorageKey = "sb-\(supabaseURL.host!.split(separator: ".")[0])-auth-token"
Task 58: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Task 58: Fatal error: Unexpectedly found nil while unwrapping an Optional value
GitHub
GitHub - supabase/supabase-swift: A Swift SDK for Supabase. Query y...
A Swift SDK for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse Swift examples, invoke postgres functions via rpc, invoke supabase edge funct...
6 Replies
garyaustin
garyaustin3w ago
That is not your API URL. Check API Settings.
What you show is the database pooler port.
Ken
KenOP3w ago
I attempted that URL host https://MYUUID.supabase.co but I ran into an error A server with the specified hostname could not be found. after googling and reading a few posts which led me to use the pooler port as noted above.
garyaustin
garyaustin3w ago
This is the correct URL.
No description
Ken
KenOP3w ago
Ah I figured it out, solution: In Xcode, I had to enable outgoing connections first via the Capabiltiies tab. Thanks again @garyaustin
Terry
Terry3w ago
Hey @ken — we're experimenting with generating and publishing troubleshooting guides based on the content of threads marked as Solved Would you mind having a quick look at this guide? https://gist.githubusercontent.com/4L3k51/372cc01ecbf90c56a4dd5fd28def709b/raw/d11aaa6a81614ca34dd3e29c17885dd5f280a7fa/preview.md It looks right, but I'm curious if it's added any extra things (like the App Sandbox bit at the end)

Did you find this page helpful?