supabase / supabase-swift

A Swift client for Supabase
https://supabase.com/docs/reference/swift
MIT License
685 stars 101 forks source link

createSignedURLs error in Supabase for Swift: body must have required property 'expiresIn' #351

Closed sbmohan1 closed 5 months ago

sbmohan1 commented 5 months ago

Discussed in https://github.com/orgs/supabase/discussions/22886

Originally posted by **sbmohan1** April 18, 2024 I'm trying to create multiple signedURLs that expire in 24 hours for my mobile app that I'm building in SwiftUI. Below is my line of code that makes the call to create signed URLs for multiple paths: `let urls = try await client.storage.from("ishq-user-photos").createSignedURLs(paths: paths, expiresIn: 60)` However I receive the following error: _StorageError(statusCode:_ Optional("400"), message: "body must have required property \'expiresIn\'", error: Optional("Error")) I'm referencing the example in the docs: https://supabase.com/docs/reference/swift/storage-from-createsignedurls But it does differ from one of the examples in the git repo: https://github.com/supabase/supabase-swift/blob/main/Examples/Examples/Storage/FileObjectDetailView.swift In the example from the git repo, a StorageFileApi is used to generate the signed URLs. Let me know if I'm doing anything wrong and how to approach this! Thanks in advance.
grdsdev commented 5 months ago

@sbmohan1 thanks for bring it up, opened a PR with the fix.