Skip to content

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

Closed
@sbmohan1

Description

@sbmohan1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions