From my understanding, we can retrieve user information via something like this:
$cordovaFacebook.api(
"me?fields=name,email,picture", ["public_profile", "email"])
.then(function (response) {
console.log(response);
}, error);
How can we directly get all available information without listing out one by one?
How can we directly get all available information without listing out one by one?
You can’t.
With API v2.4, Facebook has reduced the number of fields returned by default for the various endpoints, to improve performance (especially with regard to mobile connections.)
That was a deliberate decision – and to allow for a “way around” it, would just make a lot of lazy-a** developers still just request them all ;-)
Perhaps you have heard at some point, that in SQL f.e. a SELECT *
is considered bad practice as well – this is pretty much the same case here. You are supposed to explicitly ask for the data you need now – and not just go “I’ll request it all, and figure out what I could possible use it for later.”
If you are not sure what fields are available for a certain endpoint – then either consult the documentation for that endpoint, or use Introspection to get a list of all fields.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With