Skip to content

Commit 10b6919

Browse files
committed
WIP
1 parent 39f8bdb commit 10b6919

File tree

5 files changed

+56
-58
lines changed

5 files changed

+56
-58
lines changed

android/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
139139
from configurations.compile
140140
into 'libs'
141141
}
142+
143+
apply plugin: 'com.google.gms.google-services'

android/app/google-services.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"project_info": {
3+
"project_number": "223760557072",
4+
"firebase_url": "https://firestack-example.firebaseio.com",
5+
"project_id": "firestack-example",
6+
"storage_bucket": "firestack-example.appspot.com"
7+
},
8+
"client": [
9+
{
10+
"client_info": {
11+
"mobilesdk_app_id": "1:223760557072:android:67c954dec8dedc0e",
12+
"android_client_info": {
13+
"package_name": "com.firestackapp"
14+
}
15+
},
16+
"oauth_client": [
17+
{
18+
"client_id": "223760557072-eif2ahnjm20m5gclajmfehc4oge3bbu9.apps.googleusercontent.com",
19+
"client_type": 3
20+
}
21+
],
22+
"api_key": [
23+
{
24+
"current_key": "AIzaSyB2GmOZW-_KVn5xLnBd6HSJw2tUqlZxqyU"
25+
}
26+
],
27+
"services": {
28+
"analytics_service": {
29+
"status": 1
30+
},
31+
"appinvite_service": {
32+
"status": 1,
33+
"other_platform_oauth_client": []
34+
},
35+
"ads_service": {
36+
"status": 2
37+
}
38+
}
39+
}
40+
],
41+
"configuration_version": "1"
42+
}

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:1.3.1'
9-
9+
classpath 'com.google.gms:google-services:3.0.0'
1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
1212
}

app/views/Database/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ export class Database extends React.Component {
1515
const {firestack} = this.props;
1616
const db = firestack.database;
1717
this.db = db;
18+
db.setPersistence(true);
1819
}
1920

20-
// componentDidMount() {
21-
// const ref = this.db.ref('chat-messages').child('roomId');
22-
// ref.orderByKey().limitToLast(3).once('value').then(snapshot => {
23-
// console.log('snapshot ->', snapshot);
24-
// });
25-
// }
21+
componentDidMount() {
22+
const ref = this.db.ref('chat-messages').child('roomId');
23+
ref.orderByKey().limitToLast(3).once('value').then(snapshot => {
24+
console.log('snapshot ->', snapshot);
25+
});
26+
}
2627

2728
render() {
2829
return (

index.android.js

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,6 @@
1-
/**
2-
* Sample React Native App
3-
* https://github.com/facebook/react-native
4-
* @flow
5-
*/
1+
import React from 'react';
2+
import {AppRegistry} from 'react-native';
63

7-
import React, { Component } from 'react';
8-
import {
9-
AppRegistry,
10-
StyleSheet,
11-
Text,
12-
View
13-
} from 'react-native';
4+
import App from './app/app';
145

15-
class FirestackApp extends Component {
16-
render() {
17-
return (
18-
<View style={styles.container}>
19-
<Text style={styles.welcome}>
20-
Welcome to React Native!
21-
</Text>
22-
<Text style={styles.instructions}>
23-
To get started, edit index.android.js
24-
</Text>
25-
<Text style={styles.instructions}>
26-
Double tap R on your keyboard to reload,{'\n'}
27-
Shake or press menu button for dev menu
28-
</Text>
29-
</View>
30-
);
31-
}
32-
}
33-
34-
const styles = StyleSheet.create({
35-
container: {
36-
flex: 1,
37-
justifyContent: 'center',
38-
alignItems: 'center',
39-
backgroundColor: '#F5FCFF',
40-
},
41-
welcome: {
42-
fontSize: 20,
43-
textAlign: 'center',
44-
margin: 10,
45-
},
46-
instructions: {
47-
textAlign: 'center',
48-
color: '#333333',
49-
marginBottom: 5,
50-
},
51-
});
52-
53-
AppRegistry.registerComponent('FirestackApp', () => FirestackApp);
6+
AppRegistry.registerComponent('FirestackApp', () => App);

0 commit comments

Comments
 (0)