Open crtl opened 4 years ago
use this one for customizable facebook login button.
import { LoginManager } from 'react-native-fbsdk';
then after create one function for dynamically use in button
handleFacebookLogin () {
LoginManager.logInWithPermissions(['public_profile', 'email', 'user_friends']).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 that arrow function in onPress of button.
<TouchableOpacity style={styles.btn} onPress={this.handleFacebookLogin}>
<Text style={styles.TextStyle}>Login With Facebook </Text>
//As per change your button height using stylesheet
</TouchableOpacity>
Hey, @Manoj-coder It's work for me and i got this in logs
Login success with permissions: public_profile, email
But how can I get this data "email, username, photo" to save it in the state then i want to send it to our API to save it?
It is possible to change the button height but the button will look like shit after it. Are there some plans to provide a customizable facebook button or is everyone building it by their own?
Expected Behavior
Button should be at least customizable in sizes.
Code Example
Environment