Skip to content

Commit b61be10

Browse files
committed
Adding anonymous login
1 parent d174b33 commit b61be10

File tree

3 files changed

+55
-3
lines changed

3 files changed

+55
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react'
2+
3+
import {
4+
View,
5+
Text,
6+
NativeModules
7+
} from 'react-native'
8+
9+
import env from '../../../../config/environment';
10+
import { Container, Header, Title, Content, Button } from 'native-base';
11+
import appStyles from '../../../styles/app';
12+
13+
export class Anonymous extends React.Component {
14+
15+
componentWillMount() {
16+
const {firestack} = this.props;
17+
}
18+
19+
loginAnonymously(evt) {
20+
const {firestack} = this.props;
21+
firestack.signInAnonymously()
22+
.then(u => {
23+
console.log('Signed in!', u);
24+
})
25+
}
26+
27+
componentWillUnmount() {
28+
const {firestack} = this.props;
29+
}
30+
31+
render() {
32+
return (
33+
<Container>
34+
<Content>
35+
<Button
36+
onPress={this.loginAnonymously.bind(this)}>
37+
Anonymously login
38+
</Button>
39+
</Content>
40+
</Container>
41+
)
42+
}
43+
44+
}
45+
46+
export default Anonymous

app/views/Authentication/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,27 @@ import appStyles from '../../styles/app';
1010
import List from '../../components/List/List'
1111

1212
import Providers from './Demos/Providers';
13+
import Anonymous from './Demos/Anonymous';
1314

1415
export const Routes = {
1516
'providers': {
1617
route: {
1718
title: 'Providers',
1819
Component: Providers
1920
}
21+
},
22+
'anonymous': {
23+
route: {
24+
title: 'Anonymous login',
25+
Component: Anonymous
26+
}
2027
}
2128
}
2229

2330
export class Authentication extends React.Component {
2431
render() {
2532
const initialRows = Object.keys(Routes).map(key => {
2633
const routeCfg = Routes[key];
27-
console.log('key ->', key);
2834
return { title: routeCfg.route.title, key: `auth.${key}` }
2935
})
3036
return (

ios/FirestackApp/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@
4747
<string>Google</string>
4848
<key>CFBundleURLSchemes</key>
4949
<array>
50-
<string>com.googleusercontent.apps.223760557072-iu0fv6fau7dorfbrm74sep00j5c39ov2</string>
50+
<string>com.googleusercontent.apps.223760557072-t8hd07q4lm552na0s1id3cjj39927ptv</string>
5151
</array>
5252
</dict>
5353
</array>
5454
<key>CFBundleVersion</key>
5555
<string>76</string>
5656
<key>LSApplicationQueriesSchemes</key>
5757
<array>
58-
<string>223760557072-t6ine4mmot5ejmfg96k3huoqg9jsppnl.apps.googleusercontent.com</string>
58+
<string>com.googleusercontent.apps.223760557072-t8hd07q4lm552na0s1id3cjj39927ptv</string>
5959
<string>googlechrome-x-callback</string>
6060
<string>fbauth2</string>
6161
<string>fb1745641015707619</string>

0 commit comments

Comments
 (0)