-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
34 lines (31 loc) · 1.16 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, { Component } from 'react'
import { View, Text, TouchableOpacity } from 'react-native'
import FBSDK from 'react-native-fbsdk'
const {
LoginButton,
AccessToken
} = FBSDK;
export default class App extends Component {
render(){
return (
<View style={{ flex:1, justifyContent: 'center', alignItems:'center' }}>
<Text style={{ fontSize:25, marginBottom:15 }}>Please Log in</Text>
<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>
)
}
}