Change the FB login button text (react-native-fbsdk)

前端 未结 4 1943
误落风尘
误落风尘 2020-12-31 00:30

I am using react-native-fbsdk. How can I change the fb login button text from \'Login with facebook\' to \'Continue with fb\'?

The component looks like this, and I c

4条回答
  •  醉酒成梦
    2020-12-31 01:10

    You can use your custom function and add Login Manager into your function.

    Here is the code

    import { LoginManager } from "react-native-fbsdk";
    
    const loginWithFacebook = () => {
      LoginManager.logInWithPermissions(["public_profile", "email"]).then(
        function(result) {
          if (result.isCancelled) {
            console.log("==> Login cancelled");
          } else {
            console.log(
              "==> Login success with permissions: " +
                result.grantedPermissions.toString()
            );
          }
         },
         function(error) {
          console.log("==> Login fail with error: " + error);
         }
       );
    }
    

    Call it in your custom button

     loginWithFacebook()}>
       Login With Facebook           
    
    

提交回复
热议问题