Looking for how to use this in your app?See Frontend Libraries →
AWS SDK for S3 APIを使用する
Amplifyが機能を提供していない高度なユースケースの場合、エスケープハッチを取得してS3Clientインスタンスにアクセスできます。
以下のインポートを追加します。
import AWSS3StoragePlugin次に、このコードを使用してエスケープハッチを取得します。
do { // Retrieve the reference to AWSS3StoragePlugin let plugin = try Amplify.Storage.getPlugin(for: "awsS3StoragePlugin") guard let storagePlugin = plugin as? AWSS3StoragePlugin else { return }
// Retrieve the reference to S3Client let s3Client = storagePlugin.getEscapeHatch()
// Make requests using s3Client... // ...} catch { print("Get escape hatch failed with error - \(error)")}クライアント追加ドキュメントについては、AWS SDK for Swift クライアントドキュメントを参照してください。S3Clientコード例については、SDK for Swiftを使用したAmazon S3の例を参照してください。