mkloubert / nativescript-social-login

NativeScript plugin for social (token based) log-ins.
MIT License
42 stars 44 forks source link

Google and FB login fails on tns-android 4.0.1 #50

Closed next-apps closed 6 years ago

next-apps commented 6 years ago

I have: nativescript-social-login: 4.0.1 nativescript-cli: 4.0.1 tns-android: 4.0.1

Build was successful, however when I try to call loginWithFacebook or loginWithGoogle it doesn't work. In case of Google, it shows the "Choose account" popup, but after choosing account nothing happens. Where as facebook dont even show any dialog.

next-apps commented 6 years ago

Added logger and got the following

JS: -- doGoogleLogin -- JS: [nativescript-social-login]: (): Provider: google JS: [nativescript-social-login]: (): Will use Google sign in... JS: [nativescript-social-login]: (loginWithGoogle()): Starting activity for result... JS: [nativescript-social-login]: (onActivityResult()): Cancelled JS: [nativescript-social-login]: (onActivityResult()): result. provider = google JS: [nativescript-social-login]: (onActivityResult()): result. code = 1 JS: [nativescript-social-login]: (onActivityResult()): Calling Callback function with Results JS: result => {"provider":"google","code":1}

It is expected to return the account details like ID email etc. but got only "code":1

JS: -- doFacebookLogin -- JS: [nativescript-social-login]: (): Provider: facebook JS: [nativescript-social-login]: (): Will use Facebook SDK... JS: [nativescript-social-login]: (loginWithFacebook()): Starting activity for result... JS: [nativescript-social-login]: (loginWithFacebook()): [ERROR] runOnUiThread(): TypeError: Cannot read property 'logInWithReadPermissions' of undefined

FB login is erroring out

next-apps commented 6 years ago

This issue was because of a name change in the AppId. Fixed it by changing the AppId in Google and Facebook App Settings page.

nmandyam commented 6 years ago

I have exactly the same issue - loginWithGoogle responds with just the provider, no other info. I've checked the mobile app's SHA1 fingerprint and it's identical in Firebase. The App ID (i.e. the Project Number) from Firebase Console is correct in the google-services.json of the mobile app. The package-name is also identical in both places. But I still don't get the login-result. I'm not yet trying Facebook. @ssajith, could you please give us more detail of exactly what you did to fix the issue? Thanks!

next-apps commented 6 years ago

Could you please try to delete the contents of the platforms folder and build again.

nmandyam commented 6 years ago

Did that, no change. Cleaned out node_modules and tried again, no change. And the facebook connector does not even come up - the call to loginWithFacebook crashes the app. Not sure if this is the place for this other (related?) issue: trying to debug the app crashes it - stopping the debugger at the call to loginWithGoogle or loginWithFacebook crashes the app. Going past the call to its return, in the case of loginWithGoogle, returns OK but with no info. Any thoughts appreciated!

danielnakasato commented 6 years ago

This issue was because of a name change in the AppId. Fixed it by changing the AppId in Google and Facebook App Settings page.

@ssajith Is it related to a change made by you or something that google changed?

rkuodys commented 5 years ago

@nmandyam Have you eventually solved this issue? I'm facing the same error with FB login

nmandyam commented 5 years ago

No, unfortunately not - I just walked away from Social Signup for that app.

On Thu, Jan 17, 2019 at 5:56 PM rkuodys notifications@github.com wrote:

@nmandyam https://github.com/nmandyam Have you eventually solved this issue? I'm facing the same error with FB login

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mkloubert/nativescript-social-login/issues/50#issuecomment-455154534, or mute the thread https://github.com/notifications/unsubscribe-auth/AMDhKU1zHZBU0Qdcbzj3IKPPJI6IS_owks5vEGwHgaJpZM4T8vKW .

-- Narasimhan (Kishore) Mandyam