facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

Facebook login on Android returns isCancelled = true always (except on first installation) #797

Open olgaababic opened 3 years ago

olgaababic commented 3 years ago

I'm using latest react-native-fbsdk version (2.0.0). This is my code:

 LoginManager.logInWithPermissions(['public_profile,email'])
    .then((response) => {
      if (!response.isCancelled) {
        AccessToken.getCurrentAccessToken().then((data) => {...})
      }
   })

When I login for the first time everything works fine. After that, logInWithPermissions always returns isCancelled = true even though I didn't cancelled request. This only happens on Android, on iOS everything works fine. I noticed that it works fine when I don't ask for email: LoginManager.logInWithPermissions(['public_profile']) But when I do ask for email, it always returns isCancelled = true (except first time)

loukrath commented 3 years ago

I have the exact the same issue with Olgaababic

patrickleemsantos commented 3 years ago

Same

olgaababic commented 3 years ago

I figured out what I was doing wrong. I accidentally wrote permissions as one item of an array separated by coma: ['public_profile,email']. It should be two separated items of array ['public_profile', 'email'].

jduarter commented 3 years ago

Probably this is happening after increasing minimum API Level to 29.

jduarter commented 3 years ago

This was caused due to some GDPR issues being pending to be resolved in the Facebook Developers panel. I think this should be documented somewhere so people don't get crazy with it.