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

not getting email after facebook success oauth. #277

Closed devkamboj closed 8 years ago

devkamboj commented 8 years ago

$cordovaOauth.facebook("my_app_id", ["email,public_profile"]).then(function(result) { $localStorage.accessToken = result.access_token; console.log(result); }

i using above code but not getting email in result only access token is coming.

nraboy commented 8 years ago

The point of oauth is to get tokens that you then use towards provider APIs to get more information.

Unless it says in the documentation that the email should be returned with the access token, it is working correctly. Feel free to share the documentation if its there.

Best,

devkamboj commented 8 years ago

$http.get("https://graph.facebook.com/v2.2/me", {params: {access_token: result.access_token, fields: "name,email", format: "json" }}).success(function (data, status, headers, config) { fbemail=data.email; console.log(data); }).error(function (data, status, headers, config) { alert("Error: " + error); });

by this we can get email