File tree Expand file tree Collapse file tree 5 files changed +56
-58
lines changed Expand file tree Collapse file tree 5 files changed +56
-58
lines changed Original file line number Diff line number Diff line change @@ -139,3 +139,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
139
139
from configurations. compile
140
140
into ' libs'
141
141
}
142
+
143
+ apply plugin : ' com.google.gms.google-services'
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ buildscript {
6
6
}
7
7
dependencies {
8
8
classpath ' com.android.tools.build:gradle:1.3.1'
9
-
9
+ classpath ' com.google.gms:google-services:3.0.0 '
10
10
// NOTE: Do not place your application dependencies here; they belong
11
11
// in the individual module build.gradle files
12
12
}
Original file line number Diff line number Diff line change @@ -15,14 +15,15 @@ export class Database extends React.Component {
15
15
const { firestack} = this . props ;
16
16
const db = firestack . database ;
17
17
this . db = db ;
18
+ db . setPersistence ( true ) ;
18
19
}
19
20
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
+ }
26
27
27
28
render ( ) {
28
29
return (
Original file line number Diff line number Diff line change 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' ;
6
3
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' ;
14
5
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 ) ;
You can’t perform that action at this time.
0 commit comments