R2 upload and fetch via iOS & Android apps

I noticed some of the exising SDKs for AWS such as Go and Javascript support using R2 by manipulating the endpoint.

I’m not sure if this option exists in the iOS & Android SDK (I believe these are called amplify).

Any hints about that?


A quick google let me to this How to override AWS Amplify Api domain endpoint - Stack Overflow

Might work, but also don’t know if R2 is fully compatible with amplify

To anyone finding this thread, this was actually simpler than I thought.
This post was super helpful (Written in Go, but still):

tl;dr, I used the AWS Swift SDK (Seemingly compatible)

let credentials = AWSCredentialIdentity(
    accessKey: "your-access-key",
    secret: "your-secret"
let awsCredentialIdentityResolver = try StaticAWSCredentialIdentityResolver(credentials)
let config = try S3Client.Config(
    awsCredentialIdentityResolver: awsCredentialIdentityResolver,
    region: "auto",
    endpoint: "your-endpoint"

let s3 = S3Client(config: config)

// Use S3 client connected to R2

et-voila, works seamlessly :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.