Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floriangbh/FacebookImagePicker
FacebookImagePicker is Facebook album photo picker written in Swift.
https://github.com/floriangbh/FacebookImagePicker
facebook facebook-api facebook-graph-api facebook-login facebook-sdk facebookimagepicker-ios fbsdk image-picker picker swift
Last synced: about 1 month ago
JSON representation
FacebookImagePicker is Facebook album photo picker written in Swift.
- Host: GitHub
- URL: https://github.com/floriangbh/FacebookImagePicker
- Owner: floriangbh
- License: mit
- Archived: true
- Created: 2016-10-01T14:08:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-30T23:23:08.000Z (about 3 years ago)
- Last Synced: 2024-05-22T13:22:36.105Z (8 months ago)
- Topics: facebook, facebook-api, facebook-graph-api, facebook-login, facebook-sdk, facebookimagepicker-ios, fbsdk, image-picker, picker, swift
- Language: Swift
- Homepage: http://floriangabach.fr
- Size: 15.2 MB
- Stars: 236
- Watchers: 10
- Forks: 61
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - FacebookImagePicker - Facebook album photo picker written in Swift. (Media / Image)
- awesome-swift - FacebookImagePicker - Facebook album photo picker. (Libs / Images)
- awesome-swift - FacebookImagePicker - Facebook album photo picker. (Libs / Images)
- awesome-ios-star - FacebookImagePicker - Facebook album photo picker written in Swift. (Media / Image)
- fucking-awesome-swift - FacebookImagePicker - Facebook album photo picker. (Libs / Images)
- awesome-swift - FacebookImagePicker - FacebookImagePicker is Facebook album photo picker written in Swift. ` 📝 a month ago ` (Images [🔝](#readme))
README
Features
• Installation
• Usage
• Translation
• LicenseGBHFacebookImagePicker is ***Facebook's*** album photo picker written in Swift, built to provide a simple way to pick picture into Facebook account. The picker provides a simple interface like the native iOS photo picker.
This picker takes care of all authentication (from the web or with the native Facebook app) when necessary. If the photo's permission isn't accepted during the login, the picker prompts another permission's request.## Screenshot / Demo
![Preview](https://github.com/terflogag/FacebookImagePicker/blob/master/Ressources/preview.png)
## Features
- [x] Login with Facebook SDK and display user's Albums or tagged photos
- [x] Display pictures of each albums
- [x] Handling denied Facebook photo's permission
- [x] Multiple selection in one album
- [x] Select all## Example
In your terminal :
```ruby
pod try GBHFacebookImagePicker
```Or to run the example project manually, clone the repo, and run `pod install` from the Example directory first.
Don't forget to replace the current Facebook App's ID with your own in the plist file (Open as > Source code).
Like this :```xml
CFBundleURLTypes
CFBundleTypeRole
Editor
CFBundleURLSchemes
fb
FacebookAppID
```
Just in case, for public application (which can be use in the AppStore), you need to send your Facebook's App in review to have user's photos permission.
## Usage
- You need to set up your application correctly to work with Facebook : https://developers.facebook.com/docs/ios/getting-started and https://developers.facebook.com/docs/ios/ios9
- Import the library :
```swift
import GBHFacebookImagePicker
```- Then, implement the `GBHFacebookImagePickerDelegate` protocol :
```swift
// MARK: - GBHFacebookImagePicker Protocolfunc facebookImagePicker(imagePicker: UIViewController,
successImageModels: [GBHFacebookImage],
errorImageModels: [GBHFacebookImage],
errors: [Error?]) {
// Append selected image(s)
// Do what you want with selected image
self.imageModels.append(contentsOf: successImageModels)
}func facebookImagePicker(imagePicker: UIViewController, didFailWithError error: Error?) {
print("Cancelled Facebook Album picker with error")
print(error.debugDescription)
}// Optional
func facebookImagePicker(didCancelled imagePicker: UIViewController) {
print("Cancelled Facebook Album picker")
}// Optional
func facebookImagePickerDismissed() {
print("Picker dismissed")
}
```The imageModel contain :
```swift
public class FacebookImage {
public var image: UIImage? // The image, not nil only if image is selected
public var normalSizeUrl: String? // Normal size picture url
public var fullSizeUrl: String? // Full size source picture url
public var imageId: String? // Picture id
}
```- Display picker :
```swift
let picker = FacebookImagePicker()
picker.presentFacebookAlbumImagePicker(from: self, delegate: self)
```## Customisation
You can apply some customisation. To do it you can use the [FacebookPickerConfig structure](CUSTOMISATION.md).
## Aditionals informations
- About tagged photos : the tagged photos are displayed in an album (hide by default, see customisation section to display it) with the name "Photos of You". You can change this default name in the settings. The tagged album's cover is the facebook account profile picture, which are retrieved with a special call to the graph API.
## Translation
FacebookImagePicker is currently written in english. If you need translation for the permission popup (or whatever thing), just add this line in your localized file :
```
"Pictures" = "";
"Oups" = "";
"You need to allow photo's permission." = "";
"Allow" = "";
"Close" = "";
"Album(s)" = "";
"Photos of You" = "";
""No picture(s) in this album." = "";"
```## Requirements
* Xcode 11.4
* iOS 9.0+ target deployment
* FBSDKCoreKit, FBSDKLoginKit (>= 7.0 for the v5.0)
* Facebook Application, see [usage](#usage) for explaination
* Swift 3, 4, 4.2 or 5.1 project## Installation
FacebookImagePicker is available through [CocoaPods](http://cocoapods.org).
To install it, simply add the following line to your Podfile:```ruby
pod "GBHFacebookImagePicker"pod "GBHFacebookImagePicker", '~> 2.4' # For swift 4.0
pod "GBHFacebookImagePicker", '~> 1.3.1' # For Swift 3.1
```## Communication
- If you **need help**, open an issue.
- If you **found a bug**, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request and **read** the [contributing file](CONTRIBUTING.md).## Author
Florian Gabach, [email protected]
## License
FacebookImagePicker is available under the [MIT license](LICENSE).
If your application use this picker consider to add the licence in your Credits/About section. You can use [this library to do it](https://github.com/terflogag/OpenSourceController).