View headerRight.js
headerRight: ( | |
<TouchableOpacity | |
style={{ marginRight: 30 }} | |
onPress={() => | |
Alert.alert("Logout alert", "Do you really want to Logout...", [ | |
{ | |
text: "NO", | |
onPress: () => console.warn("NO Pressed"), | |
style: "cancel" | |
}, |
View createAppContainer.js
export default createAppContainer(DrawerNavigator); |
View initialRouteName.js
{ | |
initialRouteName: "Home", | |
headerMode: "none" | |
} |
View onAuthStateChanged.js
componentDidMount() { | |
firebase.auth().onAuthStateChanged(user => { | |
if (user) { | |
} else { | |
alert("Your have not logged in"); | |
this.props.navigation.navigate("LoggedOut"); | |
} | |
}); | |
} |
View facebooklogin.js
async FacebookLogin() { | |
const result = await LoginManager.logInWithPermissions([ | |
"public_profile", | |
"email" | |
]); | |
if (result.isCancelled) { | |
throw new Error("User cancelled the login process"); | |
} | |
const data = await AccessToken.getCurrentAccessToken(); |
View appdelegate.m
- (BOOL)application:(UIApplication *)application | |
openURL:(NSURL *)url | |
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { | |
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options] | |
]; | |
// Add any custom logic here. | |
return handled; | |
} |
NewerOlder