Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skyfloyd/ionic2-fb-gallery
Facebook gallery photo picker for Ionic 2
https://github.com/skyfloyd/ionic2-fb-gallery
Last synced: 3 months ago
JSON representation
Facebook gallery photo picker for Ionic 2
- Host: GitHub
- URL: https://github.com/skyfloyd/ionic2-fb-gallery
- Owner: skyfloyd
- Created: 2016-12-13T23:56:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T23:05:51.000Z (almost 8 years ago)
- Last Synced: 2024-05-09T07:32:26.490Z (6 months ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ionic2-components - Facebook Gallery
- Awesome - Facebook Gallery
README
# ionic2-fb-gallery
Facebook gallery photo picker for Ionic 2## Installation
* Create Ionic project
* Install `cordova-plugin-facebook4` by this command
```bash
$ ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"
```
Find more details here [https://ionicframework.com/docs/v2/native/facebook/](https://ionicframework.com/docs/v2/native/facebook/)
* Copy `ionic2-fb-gallery` `module` folder to `app` folder
* Import `FbModule` to your app base `@NgModule`## Usage
* Call init() method of SocialApiService class object. Example here:
```bash
constructor( private socialApi:SocialApiService ) {
this.socialApi.subscribeToStatusChange( ()=>{ /* onApiReady(); */ }, SocialApiService.getApiStatus_appUser() );
this.socialApi.init();
}
```
This plugin use [ionic2-fb-api](https://github.com/skyfloyd/ionic2-fb-api/) plugin to connect with Facebook. Please take a look to [ionic2-fb-api documentation](https://github.com/skyfloyd/ionic2-fb-api/) for more info.* You have 2 options to open Facebook gallery photo picker dialog
* Call `FbGallery` `init` function. It takes your callback as it's only parameter. Example here:
```bash
constructor( private fbGallery:FbGallery ) {}public chooseFromFacebook():void{
this.fbGallery.init((url, name)=>{
/* do something here */
});
}
```* Use `fb-gallery` directive. Example here:
**HTML file**
```bash
Choose from Facebook
```**TypeScript file**
```bash
public facebookGalleryCallback():any{
return (url, name)=>{
/* do something here */
};
}
```
## DEMO
[ionic2-fb-api DEMO](https://www.youtube.com/watch?v=dhC_6VZnI1w)
Thats all.