prachiFam / amazon_s3_cognito

this is a Flutter plugin allows users to upload and delete image for amazon s3 cognito
Other
16 stars 24 forks source link

iOS return empty string. #18

Open KanwarpreetS opened 4 years ago

KanwarpreetS commented 4 years ago

Function to test

String uploadedImageUrl = await AmazonS3Cognito.uploadImage(
    path,
    'myalbum/$_userId/$_albumId',
    'us-east-1:xxxxxx-xx-xx-xx-xxxxx');

print('url: ' + uploadedImageUrl);

if(uploadedImageUrl == "Failed" || uploadedImageUrl.isEmpty){
  var snackBar = SnackBar(content: Text("Uploading Failed!"));
  _scaffoldKey.currentState.showSnackBar(snackBar);
} else{
  _createEntryToServer(uploadedImageUrl, myAlbum.id);
}

Working fine on Android

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.5) [✓] Android Studio (version 4.0) [✓] IntelliJ IDEA Community Edition (version 2019.2.4) [✓] Connected device (2 available)

• No issues found!

pubspec.yaml dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter

cupertino_icons: ^0.1.2 http: ^0.12.0 file_picker: ^1.12.0 shared_preferences: ^0.5.7+3 amazon_s3_cognito: ^0.2.4

yswtrue commented 4 years ago

same issue

jonivesto commented 4 years ago

Same here.

Works fine on Android. The bucket is public and has all the permissions possible.

oggam commented 4 years ago

Same here, Android .csv upload works like charm - iOS not working and no exception / error logs. Also my bucket is public!

KanwarpreetS commented 4 years ago

Same is the case with me, The bucket is public and has all the permissions possible. Android works like a charm but iOS always return a empty String in return.

jonivesto commented 4 years ago

I spent a lot of time on this and ended up solving the issue by using a different upload method for iOS.

Here's what I used: https://stackoverflow.com/a/54983831

Hope it helps if u are stuck in this:) @oggam @KanwarpreetS

oggam commented 4 years ago

Many thanks @jonivesto it's great to have a workaround but the library should definitely support it out-of-the-box, so in my case I will wait for an update.

rodrigocorrea commented 3 years ago

Does any body know if it issue is fixed? Thanks in advance

zhihaozhang commented 3 years ago

@rodrigocorrea @oggam @KanwarpreetS @jonivesto You can try my fork here, which works on my side.

nabhanhanif commented 3 years ago

@rodrigocorrea @oggam @KanwarpreetS @jonivesto You can try my fork here, which works on my side.

I did try your fork. Can't even build the application. I get the following errors

/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:189:11: error: cannot find 'AWSS3TransferManager' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:132:31: error: cannot find 'AWSS3TransferManagerUploadRequest' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:80:15: error: cannot find 'AWSS3TransferManager' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:31:35: error: cannot find 'AWSS3TransferManagerUploadRequest' in scope
        NSString * partFileName = [self createTemporaryFileForPart:transferUtilityMultiPartUploadTask.file partNumber:[subTask.partNumber integerValue] dataLength:subTask.totalBytesExpectedToSend error:&error];

Error output from Xcode build:

zhihaozhang commented 3 years ago

@rodrigocorrea @oggam @KanwarpreetS @jonivesto You can try my fork here, which works on my side.

I did try your fork. Can't even build the application. I get the following errors

/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:189:11: error: cannot find 'AWSS3TransferManager' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:132:31: error: cannot find 'AWSS3TransferManagerUploadRequest' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:80:15: error: cannot find 'AWSS3TransferManager' in scope
/Users/nabhanhanif/development/flutter/.pub-cache/git/amazon_s3_cognito-7d3d5344cf520132ead24a4da9db48308dbd6fc8/ios/Classes/SwiftAmazonS3CognitoPlugin.swift:31:35: error: cannot find 'AWSS3TransferManagerUploadRequest' in scope
        NSString * partFileName = [self createTemporaryFileForPart:transferUtilityMultiPartUploadTask.file partNumber:[subTask.partNumber integerValue] dataLength:subTask.totalBytesExpectedToSend error:&error];

Error output from Xcode build:

Put this line in your pubspec.yaml file: amazon_s3_cognito: git: url: https://github.com/verbinc/amazon_s3_cognito.git