Skip to content

Latest commit

 

History

History
70 lines (61 loc) · 1.75 KB

File metadata and controls

70 lines (61 loc) · 1.75 KB

FFile

CI Status Version License Platform

Requirements

iOS >= 8.0

Installation

FFile is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "FFile"

Getting Started

FFile.setup("<Your AWS identity pool Id>",
 s3URL: "<AWS Region URL>",
 s3Bucket: "<AWS bucket>", 
 s3Region: "<Your AWS bucket region>" 

Description

Save file

  • 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

Get data

//use objectId to get your file
let file = FFile(objectId: objectId)
file.getDataInBackgroundWithBlock { data, error in
    if error {
        // handle error
    } else {
        // use your data
    }
}

Author

muqq, bbbb55952000@gmail.com

License

FFile is available under the MIT license. See the LICENSE file for more info.