iOS >= 8.0FFile is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "FFile"FFile.setup("<Your AWS identity pool Id>",
s3URL: "<AWS Region URL>",
s3Bucket: "<AWS bucket>",
s3Region: "<Your AWS bucket region>" - identity pool Id: Follow this link: http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html
- s3URL: https://s3-ap-northeast-1.amazonaws.com/
- s3Bucket: Muqq
- s3Region: AWSRegionAPNortheast1
- Save to S3
let file = FFile(name: "example", data: data, fileExtension: "png")
file.saveInBackgroundWithBlock { success, error in
if success {
//Do something if success
} else {
// handle error
}
}- After saved to S3, upload the file reference with your data to firebase
//get your objectId and save it to anywhere
file.objectId//use objectId to get your file
let file = FFile(objectId: objectId)
file.getDataInBackgroundWithBlock { data, error in
if error {
// handle error
} else {
// use your data
}
}muqq, bbbb55952000@gmail.com
FFile is available under the MIT license. See the LICENSE file for more info.