capacitor-community / facebook-login

Facebook Login support
MIT License
103 stars 52 forks source link

FB is not defined - Plugin is using Web while testing on Android. #68

Closed andrewl94 closed 2 years ago

andrewl94 commented 2 years ago

Describe the bug Receving "ReferenceError: FB is not defined" - it also appears to try using the Web.js one, trying to open an tab on browser - I'm testing on Android. When I remove the web configuration, the following error occurs:

Error log FacebookLoginWeb.login {permissions: Array(1)}permissions: ['email'][[Prototype]]: Object login_social.js:38 ReferenceError: FB is not defined at web.js:22 at new Promise () at FacebookLoginWeb. (web.js:21) at Generator.next () at web.js:7 at new Promise () at __awaiter (web.js:3) at FacebookLoginWeb.login (web.js:19) at Object.login_social.facebook (login_social.js:17)

Smartphone (please complete the following information):

Additional context I've upgraded to Capacitor 3 from 2, and then upgraded the plugin to the latest version.

rdlabo commented 2 years ago

You should add SDK before using plugin: https://github.com/capacitor-community/facebook-login#web-configuration

pferreirafabricio commented 1 year ago

I was getting the same error besides implementing the instructions https://github.com/capacitor-community/facebook-login#web-configuration correctly.

I was getting this error on console https://connect.facebook.net/en_US/sdk.js net::ERR_BLOCKED_BY_CLIENT. So this was a problem with my browser configuration (Edge), so I change it on Privacy, search, and services -> Tracking prevention and I set the "Balanced" option