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

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

Open sbmohan1 opened this issue 2 years ago • 1 comments

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.

sbmohan1 avatar Apr 20 '24 17:04 sbmohan1

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

grdsdev avatar Apr 22 '24 12:04 grdsdev