capacitor-community / facebook-login

Facebook Login support
MIT License
103 stars 54 forks source link

Unable to work on Android device #18

Closed dodomui closed 3 years ago

dodomui commented 3 years ago

Describe the bug Unable to work on Android device.

Here is the log from Android studio.

2020-10-08 10:33:47.226 13531-13768/... V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 56064832, pluginId: FacebookLogin, methodName: login
2020-10-08 10:33:47.226 13531-13531/... I/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 61747 - Msg: email
2020-10-08 10:33:47.226 13531-13768/... V/Capacitor: callback: 56064832, pluginId: FacebookLogin, methodName: login, methodData: {"permissions":["email"]}
2020-10-08 10:33:47.227 13531-13668/... D/Capacitor/FacebookLogin: Entering login()
2020-10-08 10:33:47.268 13531-13531/... I/HwSecImmHelper: mSecurityInputMethodService is null
2020-10-08 10:33:47.321 13531-13531/... D/Capacitor: App paused
2020-10-08 10:33:47.322 13531-13531/... D/ZrHung.AppEyeUiProbe: stop checker.
2020-10-08 10:33:47.382 13531-13531/... I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
2020-10-08 10:33:47.385 13531-13531/... W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@db3679e
2020-10-08 10:33:47.386 13531-13531/... D/ZrHung.AppEyeUiProbe: notify runnable to start.
2020-10-08 10:33:47.388 13531-13531/... V/ActivityThread: Skipping new config:{1.0 502mcc153mnc [en_MY,ms_GB,zh_GB_#Hans,zh_TW_#Hant] ldltr sw360dp w360dp h709dp 480dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=Rect(0, 90 - 1080, 2218) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.10}, config:{1.0 502mcc153mnc [en_MY,ms_GB,zh_GB_#Hans,zh_TW_#Hant] ldltr sw360dp w360dp h709dp 480dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=Rect(0, 90 - 1080, 2218) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.10} for app:...
2020-10-08 10:33:47.397 13531-13531/... V/ActivityThread: callActivityOnCreate
2020-10-08 10:33:47.406 13531-13531/... I/HwPhoneWindow: updateLayoutParamsColor false mSpecialSet=false, mForcedNavigationBarColor=false, navigationBarColor=0, mNavBarShow=false, mIsFloating=false
2020-10-08 10:33:47.407 13531-13531/... I/HwPhoneWindow: updateLayoutParamsColor true mSpecialSet=true, mForcedNavigationBarColor=false, navigationBarColor=fffcfcfc, mNavBarShow=false, mIsFloating=false
2020-10-08 10:33:47.423 13531-13531/... D/ActivityThread: add activity client record, r= ActivityRecord{759367c token=android.os.BinderProxy@db3679e {.../com.facebook.FacebookActivity}} token= android.os.BinderProxy@db3679e
2020-10-08 10:33:47.447 13531-13531/... D/ZrHung.AppEyeUiProbe: notify runnable to start.

To Reproduce Steps to reproduce the behavior: After call await FacebookLogin.login({ permissions: FACEBOOK_PERMISSIONS }) it just stop without any response.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information): Android: 9.1.0

Plugin: "@capacitor-community/facebook-login": "^1.0.2",

Ionic: Ionic CLI : 6.11.11 (/Users/.../.nvm/versions/node/v12.16.1/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.3.4 @angular-devkit/build-angular : 0.1001.4 @angular-devkit/schematics : 10.1.4 @angular/cli : 10.1.4 @ionic/angular-toolkit : 2.3.3

Capacitor:

Capacitor CLI : 2.4.2 @capacitor/core : 2.4.2

Utility:

cordova-res : 0.15.1 native-run : 1.2.1

System:

NodeJS : v12.16.1 (/Users/.../.nvm/versions/node/v12.16.1/bin/node) npm : 6.14.8 OS : macOS Catalina

Additional context Add any other context about the problem here.

urfandurrani commented 3 years ago

I have the same issue.
Vue.js, with capacitor and vuetify Followed the instructions to configure/implement

my login page has a button to allow user to login using FB (along with other options) fb login method calls: let result = await FacebookLogin.login({ permissions: ['email', 'public_profile'] });

It then checks for the accessToken as part of result If thats ok it uses a call to window.FB.api('/me', { fields: 'email,first_name,last_name,id' }, function (response) { ... inside a promise

FB login works on chrome in dev mode, token returns to vue page and it is then able to proceed having validated login

Running through Android studio onto a device (tried different physical devices, different tablets, too) vue page loads, user clicks FB login button:- it loads the FB login page, which is confirmed

but token supplied then fails validation checks as the token messagereports

"An active access token must be used to query information about the current user"

oAuthException, code: 2500

I also can see my (correct) application ID declinedPermissions: [] epires (dated in december 2020) permissions: public_profile, email recentlyDeniedPermissions: []

cvillavicencio01 commented 3 years ago

I have the same problem.

But it only comes with versions of Android 9 and up...

cvillavicencio01 commented 3 years ago

Hey I've found the solution. There is no problem with the capacitor plugin.

The solution: You need to configure your Facebook app in Facebook developers.

https://stackoverflow.com/questions/41861564/server-error-code-1675030-message-error-performing-query

dodomui commented 3 years ago

@cvillavicencio01, I did configure my tester FB account as Facebook developers Admin. The problem is still there.

By the way, I did try with CapacitorFirebaseAuth plugin for Facebook Login at android device, it work just fine. So I suppose that my Android and Facebook developer configuration is just fine.

rdlabo commented 3 years ago

Please check demo environment. My env is work well.

Thanks.