1-
21# react-native-firebaseui
32
43## Requirements
4+
55We assume you already have firebase sdk installed and configured.
66We're using this great library:
7- https://github.com/invertase/react-native-firebase
7+ [ react-native-firebase ] ( https://github.com/invertase/react-native-firebase )
88
99## Getting started
1010
@@ -15,15 +15,18 @@ https://github.com/invertase/react-native-firebase
1515` $ react-native link react-native-firebaseui `
1616
1717For iOS add the following pod to your podfile:
18- ```
18+
19+ ``` pod
1920pod ' SDWebImage' , ' ~> 4.0'
2021```
22+
2123and run pod install.
2224
2325## Android Additional step for PhotoView Library
2426
2527Add this in your root build.gradle file (usually under ` android/build.gradle ` ):
26- ```
28+
29+ ``` gradle
2730allprojects {
2831 repositories {
2932 ...
@@ -34,7 +37,6 @@ allprojects {
3437
3538### Manual installation
3639
37-
3840#### iOS
3941
40421 . In XCode, in the project navigator, right click ` Libraries ` ➜ ` Add Files to [your project's name] `
@@ -45,62 +47,67 @@ allprojects {
4547#### Android
4648
47491 . Open up ` android/app/src/main/java/[...]/MainApplication.java `
48- - Add ` import io.rumors.reactnativefirebaseui.RNFirebaseUiPackage; ` to the imports at the top of the file
49- - Add ` new RNFirebaseUiPackage() ` to the list returned by the ` getPackages() ` method
50+
51+ - Add ` import io.rumors.reactnativefirebaseui.RNFirebaseUiPackage; ` to the imports at the top of the file
52+ - Add ` new RNFirebaseUiPackage() ` to the list returned by the ` getPackages() ` method
53+
50542 . Append the following lines to ` android/settings.gradle ` :
51- ```
52- include ': react-native-firebase-ui '
53- project(': react-native-firebase-ui ').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase-ui/android')
54- ```
55+
56+ ``` gradle
57+ include ':react-native-firebase-ui'
58+ project(':react-native-firebase-ui').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase-ui/android')
59+ ```
60+
55613 . Insert the following lines inside the dependencies block in ` android/app/build.gradle ` :
56- ```
57- compile project(': react-native-firebase-ui ')
58- ```
5962
63+ ``` gradle
64+ compile project(':react-native-firebase-ui')
65+ ```
6066
6167## Usage
68+
6269``` javascript
63- import { ImageView , PhotoView } from ' react-native-firebaseui'
70+ import { ImageView , PhotoView } from ' react-native-firebaseui' ;
6471
6572// no zoom support
6673export class MyFirebaseImageView extends Component < void , void , void > {
67- constructor (props ){
68- super (props)
74+ constructor (props ) {
75+ super (props);
6976 }
7077
7178 render () {
72- let imageProps = this .props
79+ let imageProps = this .props ;
7380
7481 return (
7582 < ImageView
7683 {... imageProps}
77- path= ' firebase/storage/path'
84+ path= " firebase/storage/path"
7885 defaultSource= {require (' ./placeholder.png' )} // optional, show placeholder until image is loaded
7986 timestamp= {0 } // optional, can be used to specify last modified time for same storage path
80- resizeMode= ' cover' // 'cover', 'contain', 'stretch'
87+ resizeMode= " cover" // 'cover', 'contain', 'stretch', 'center '
8188 / >
82- )
89+ );
8390 }
8491}
8592
8693// zoom support (android only). On iOS just wrap the ImageView with a scroll view
8794export class MyFirebasePhotoView extends Component < void , void , void > {
88- constructor (props ){
89- super (props)
95+ constructor (props ) {
96+ super (props);
9097 }
9198
9299 render () {
93- let imageProps = this .props
100+ let imageProps = this .props ;
94101
95102 return (
96103 < PhotoView
97104 {... imageProps}
98- path= ' firebase/storage/path'
105+ path= " firebase/storage/path"
99106 defaultSource= {require (' ./placeholder.png' )} // optional, show placeholder until image is loaded
100107 timestamp= {0 } // optional, can be used to specify last modified time for same storage path
101- resizeMode= ' cover' // 'cover', 'contain', 'stretch'
108+ resizeMode= " cover" // 'cover', 'contain', 'stretch', 'center '
102109 / >
103- )
110+ );
104111 }
105112}
106113```
0 commit comments