diff --git a/example/demo/README.md b/example/demo/README.md index 64cd7835..222bfeec 100644 --- a/example/demo/README.md +++ b/example/demo/README.md @@ -1,11 +1,16 @@ -### Android +### Description -1) Add your `google-services.json` inside of `android/app` -- make sure the `package_name` inside of your file points to `com.demo` +This example project implements `react-native-firebase` as described in the +[installation instructions](http://invertase.io/react-native-firebase/#/initial-setup). -### iOS +### Usage -1) Add GoogleService-Info.plist -- make sure the `BUNDLE_ID` inside of your file points to `com.demo` -2) Run pod install -3) Open up `demo.xcworkspace` +1) Install `node_modules`: `$ yarn` + +#### iOS +1) Go into ios root directory where the `Podfile` is located +2) Install pods: `$ pod install` +3) Run app: `$ react-native run-ios` + +#### Android +1) Run app: `$ react-native run-android` diff --git a/example/demo/android/app/build.gradle b/example/demo/android/app/build.gradle index ded64adb..767ccba1 100644 --- a/example/demo/android/app/build.gradle +++ b/example/demo/android/app/build.gradle @@ -135,6 +135,7 @@ android { dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" + compile "com.google.android.gms:play-services-base:11.0.0" compile "com.facebook.react:react-native:+" // From node_modules compile(project(':react-native-firebase')) { diff --git a/example/demo/app.js b/example/demo/app.js index c4cd4e83..9acb7162 100644 --- a/example/demo/app.js +++ b/example/demo/app.js @@ -1,13 +1,28 @@ import React from 'react' -import { View } from 'react-native' +import { View, Text, StyleSheet } from 'react-native' import firebase from './lib/firebase' export default class App extends React.Component { render () { return ( + style={styles.container} + > + + Successfully imported and running react-native-firebase. + + + Running app: {firebase.apps} + + ) } } + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center' + } +}) diff --git a/example/demo/ios/GoogleService-Info.plist b/example/demo/ios/GoogleService-Info.plist new file mode 100755 index 00000000..d4c6b920 --- /dev/null +++ b/example/demo/ios/GoogleService-Info.plist @@ -0,0 +1,40 @@ + + + + + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 305229645282-22imndi01abc2p6esgtu1i1m9mqrd0ib.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.305229645282-22imndi01abc2p6esgtu1i1m9mqrd0ib + API_KEY + AIzaSyAcdVLG5dRzA1ck_fa_xd4Z0cY7cga7S5A + GCM_SENDER_ID + 305229645282 + PLIST_VERSION + 1 + BUNDLE_ID + com.demo + PROJECT_ID + rnfirebase-b9ad4 + STORAGE_BUCKET + rnfirebase-b9ad4.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:305229645282:ios:7b45748cb1117d2d + DATABASE_URL + https://rnfirebase-b9ad4.firebaseio.com + + diff --git a/example/demo/ios/demo.xcodeproj/project.pbxproj b/example/demo/ios/demo.xcodeproj/project.pbxproj index 19759842..ef1613f9 100644 --- a/example/demo/ios/demo.xcodeproj/project.pbxproj +++ b/example/demo/ios/demo.xcodeproj/project.pbxproj @@ -37,7 +37,7 @@ 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; 2DCD954D1E0B4F2C00145EB5 /* demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* demoTests.m */; }; 49AD62206CA8125FA248442D /* libPods-demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D93F5A58817D14210226E62 /* libPods-demo.a */; }; - 4BDB01FB1F0C62DC00A6D842 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4BDB01FA1F0C62DC00A6D842 /* GoogleService-Info.plist */; }; + 4BDB021C1F0D1A8D00A6D842 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4BDB021B1F0D1A8D00A6D842 /* GoogleService-Info.plist */; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; B3E16CE8D9F2A527C5ABD05B /* libPods-demoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B45536C36F1FEF9D53052C8D /* libPods-demoTests.a */; }; @@ -276,7 +276,7 @@ 38D59AE4857D495E0D1B8579 /* Pods-demoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-demoTests/Pods-demoTests.release.xcconfig"; sourceTree = ""; }; 43A2ECAC58D0BA9375086208 /* Pods-demoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-demoTests/Pods-demoTests.debug.xcconfig"; sourceTree = ""; }; 486E30F10089C88A7332A528 /* libPods-demo-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demo-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BDB01FA1F0C62DC00A6D842 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "demo/GoogleService-Info.plist"; sourceTree = ""; }; + 4BDB021B1F0D1A8D00A6D842 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 4DCEEBCB96250D77968E696E /* Pods-demo-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-demo-tvOS/Pods-demo-tvOS.debug.xcconfig"; sourceTree = ""; }; 5D0D3588A545278D0BE6BF2B /* Pods-demo-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo-tvOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-demo-tvOSTests/Pods-demo-tvOSTests.release.xcconfig"; sourceTree = ""; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; @@ -443,7 +443,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, - 4BDB01FA1F0C62DC00A6D842 /* GoogleService-Info.plist */, + 4BDB021B1F0D1A8D00A6D842 /* GoogleService-Info.plist */, ); name = demo; sourceTree = ""; @@ -934,7 +934,7 @@ files = ( 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, - 4BDB01FB1F0C62DC00A6D842 /* GoogleService-Info.plist in Resources */, + 4BDB021C1F0D1A8D00A6D842 /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; };