import { transferUtility } from 'react-native-s3';Return: Promise - will resolve arguments:
- Boolean -
trueorfalsedepending on the setup successful.
optionsObjectregionString - a S3 Region (default: eu-west-1)access_keyString - the AWS access key IDsecret_keyString - the AWS secret access keysession_tokenString - (optional)
Return: Promise - will resolve arguments:
- Boolean -
trueorfalsedepending on the setup successful.
optionsObjectregionString - a S3 Region (default: eu-west-1)identity_pool_idString - the Amazon Cogntio identity poolcognito_regionString - a Cognito Region (default: eu-west-1)cachingBoolean - useCognitoCachingCredentialsProviderinstead ofCognitoCredentialsProvider(Android)
See AWS CognitoCredentialsProvider (iOS/Android) for more information.
Return: Promise - will resolve arguments:
- Boolean -
trueorfalsedepending on the setup successful.
New a upload task.
optionsObjectbucketString - a S3 bucket namekeyString - the object key/destination in the bucketfileString - the file path to uploadmetaObjectcontentTypeString - the file content-typecontentMD5String - the file md5 hash (optional)
Return: Promise - will resolve, see following arguments:
- Object - a Task object
or reject.
New a download task.
optionsObjectbucketString - a S3 bucket namekeyString - the object key/destination in the bucketfileString - donwload save file path
Return: Promise - will resolve, see following arguments:
- Object - a Task object
or reject.
idNumber - a Task id
idNumber - a Task id
idNumber - a Task id
idNumber - a Task id
Return: Promise - will resolve, see following arguments:
- Boolean -
trueorfalsedepending on the delete task record successful.
Gets a Task object with the given id.
idNumber - a Task id
Return: Promise - will resolve, see following arguments:
- Object - a Task object
Gets a Task object list with the type.
typeString - enum:upload,downloadidAsKeyBoolean - true: return Object with id as key, false: return Array
Return: Promise - will resolve, see following arguments:
- Array - a Task object list
Subscribe the task changes with the given id.
idNumber - a Task ideventHandlerFunction - arguments:taskObject - a Task object
Unsubscribe the task changes with the given id.
idNumber - a Task id
{
id: Number,
state: String, // task state
// progress of task: bytes / totalBytes
bytes: Number,
totalBytes: Number,
bucket: String,
key: String
}It will not be immediately refresh, you must subscribe or call getTask(id) to replace it.
waitingin_progresspausecanceledcompletedfailed