I am implementing fb sdk in react native app. I have done all changes from link, and running in android device.
invariant violation: Native component for RCTFBLoginButton does not exist this error is located at: in RCTFBLoginButton
I searched a lot but none helped me to get rid of this issue. referece this and this.
I think android facebook sdk verison and react facebook sdk version have mismatch, but don't know how to resolve it.
I am stuck from hours :/
import React from 'react';
import { StyleSheet, Alert, View } from 'react-native';
const FBSDK = require('react-native-fbsdk');
const {
LoginButton,
AccessToken
} = FBSDK;
export default class Login extends React.Component {
render() {
return (
<View>
<LoginButton
publishPermissions={["publish_actions"]}
onLoginFinished={
(error, result) => {
if (error) {
alert("login has error: " + result.error);
} else if (result.isCancelled) {
alert("login is cancelled.");
} else {
AccessToken.getCurrentAccessToken().then(
(data) => {
alert(data.accessToken.toString())
}
)
}
}
}
onLogoutFinished={() => alert("logout.")}/>
</View>
);
}
}