nraboy / ng-cordova-oauth

AngularJS oauth library for use with Apache Cordova projects
https://www.thepolyglotdeveloper.com
MIT License
456 stars 199 forks source link

facebook permissions #308

Closed kennethwwu closed 7 years ago

kennethwwu commented 7 years ago

i am trying to add 'publish_pages' and 'manage_pages' permissions to allow the user can like the facebook post in my mobile app when user login with facebook account. i realise that facebook updates their like api. but the access_token return by $cordovaOauth.facebook doesn't contain these permissions. here is my code

`var facebookLogin = function(){ var deferred = $q.defer(); $cordovaOauth.facebook("XXXXXXXXX", ["email", "publish_actions", "publish_pages"]).then(function(result) { console.log(result); deferred.resolve(result); //return result; }, function(error) { // error console.log(error); deferred.reject(error); //return false });

return deferred.promise;

};`

nraboy commented 7 years ago

You'll have to read the Facebook API documentation or consult Stack Overflow. This library was designed on the RESTful oauth spec that Facebook has in their documentation.