keppelen / react-facebook-login

A Component React for Facebook Login
1.18k stars 406 forks source link

Default version of FB SDK is outdated #241

Closed sbolel closed 5 years ago

sbolel commented 6 years ago

Summary

The default FB SDK version is outdated.

Current Behavior

The defaultProps.version is currently set to v2.3. The Facebook JavaScript reference no longer lists v2.3 of the SDK -- v2.7 is the oldest version listed.

Expected Behavior

The default FB SDK version should be changed to the latest, v3.1, if breaking changes don't have an impact. At a minimum, it should be updated to v2.7 so that users of this package can reference accurate docs.

GustavoDinizMonteiro commented 5 years ago

@sbolel I've seen that in the documentation is a version parameter with the purpose of defining the API version, have you already tested it ?

sbolel commented 5 years ago

@GustavoDinizMonteiro that's correct, it's one of the props:

      <FacebookLogin
       version="3.1"  // now we're using the latest version
        appId="1088597931155576"
        autoLoad={true}
        fields="name,email,picture"
        callback={this.responseFacebook}
      />

...and that prob overrides the defaultProps.version:

  static defaultProps = {
    redirectUri: typeof window !== 'undefined' ? window.location.href : '/',
    scope: 'public_profile,email',
    returnScopes: false,
    xfbml: false,
    cookie: false,
    authType: '',
    fields: 'name',
    version: '2.3',   // this is outdated
    language: 'en_US',
    disableMobileRedirect: false,
    isMobile: getIsMobile(),
    onFailure: null,
    state: 'facebookdirect',
    responseType: 'code',
  };

...and that resolves the issue!

I feel like it would still be good to increase the default version to one that is officially supported by facebook. It's easy to overlook the version prop 😅

GustavoDinizMonteiro commented 5 years ago

@sbolel oh yes, I agree with you, I was thinking that you were not able to change the version :sweat_smile: rsrsrs . I agree with you, so i'll make a pr for solve this :smile:.

sbolel commented 5 years ago

Awesome! :) This is an excellent library, and i think having the version updated will make it that much better. Let me know if I can help with anything!

GustavoDinizMonteiro commented 5 years ago

This issue can be closed now

sbolel commented 5 years ago

Awesome work @GustavoDinizMonteiro! I closed the issue as your PR fixes it. Much appreciated.