Facebook Graph API console error - Stack Overflow
stackoverflow.com
You are trying to call the API without asking the user to login first. Instead, remove
the FB.api line in your code and replace it with the below: