-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
39 lines (36 loc) · 1.22 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
35
36
37
38
39
import React, { Component } from 'react';
import {
Text,
View,
TouchableOpacity,
} from 'react-native';
import InstagramLogin from './config/services/instagramView';
import CookieManager from 'react-native-cookies';
export default class App extends Component {
state = {
token: "",
}
render() {
return (
<View>
<TouchableOpacity style={{ height: 30, width: 70, backgroundColor: "green" }} onPress={() => this.refs.instagramLogin.show()}>
<Text style={{ color: 'white' }}>Login</Text>
</TouchableOpacity>
<TouchableOpacity style={{ height: 30, width: 70, backgroundColor: "red" }} onPress={() => CookieManager.clearAll().then((a) => { alert(a) })}>
<Text style={{ color: 'white' }}>Claer</Text>
</TouchableOpacity>
<InstagramLogin
ref='instagramLogin'
clientId='331f9a9519b842319aae653cc50907a0'
redirectUrl="https://www.instagram.com"
scopes={['basic', 'public_content']}
onLoginSuccess={(token) => {
console.log("Token: " + token); this.setState({ token })
}}
onLoginFailure={(data) => { }// alert("asd" + JSON.stringify(data))
}
/>
</View>
);
}
}