Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orcaman/ng-facebook
https://github.com/orcaman/ng-facebook
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/orcaman/ng-facebook
- Owner: orcaman
- Created: 2014-06-30T23:33:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-30T23:41:26.000Z (over 10 years ago)
- Last Synced: 2024-10-20T17:35:56.840Z (3 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ng-facebook
Simple Facebook Service Provider for Angular.js. Used on https://github.com/orcaman/CardsFeed
## HOW TO:
See demoApp.js. Basically, you need to set your facebook's app ID and permissions scope and that's it.
## Methods exposed:
facebook.graph(string, callback): get any result set from FB Graph API.
```
facebook.graph('/me/notifications', onNotificationsGotten);
```facebook.login(callback): start the OAuth2 authentication and authorization flow. this is where the user approves your app / logs in.
```
$scope.connectToFB = function() {
facebook.login(function(result) {
if (result.expiresIn && result.expiresIn > 0) {
statusChangeCallback({"status" : "connected"})
}
});
}
```configure your app's ID and required permissions on the config section:
```
angular.module('').config(function(facebookProvider){
facebookProvider.setAppID('');
facebookProvider.setScope('');
})
```Replace these values with the values that correspond to your app:
"YOUR_ANGULAR_APP" - your angular app ID (ng-app)
"YOUR_FACEBOOK_APPID" - your facebook app ID (for example: "234229944")
"YOUR_FACEBOOK_APP_PERMISSIONS_SCOPE" - permissions required by your app (for example: "manage_notifications")