Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 266f9c3

Browse files
authored
Merge pull request #183 from brianjd/update-readme
Added JS syntax highlighting
2 parents 919066c + 1665947 commit 266f9c3

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

‎README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To use Firestack, we'll need to have a development environment that includes the
6464

6565
### iOS (with cocoapods)
6666

67-
Unfortunately, due to AppStore restrictions, we currently do _not_ package Firebase libraries in with Firestack. However, the good news is we've automated the process (with many thanks to the Auth0 team for inspiration) of setting up with cocoapods. This will happen automatically upon linking the package with `react-native-cli`.
67+
Unfortunately, due to AppStore restrictions, we currently do _not_ package Firebase libraries in with Firestack. However, the good news is we've automated the process (with many thanks to the Auth0 team for inspiration) of setting up with cocoapods. This will happen automatically upon linking the package with `react-native-cli`.
6868

6969
**Remember to use the `ios/[YOUR APP NAME].xcworkspace` instead of the `ios/[YOUR APP NAME].xcproj` file from now on**.
7070

@@ -198,15 +198,15 @@ Each platform uses a different setup method after creating the project.
198198

199199
### iOS
200200

201-
After creating a Firebase project, click on the [Add Firebase to your iOS app](http://d.pr/i/3sEL.png) and follow the steps from there to add the configuration file. You do _not_ need to set up a cocoapods project (this is already done through firestack). Make sure not to forget the `Copy Files` phase in iOS.
201+
After creating a Firebase project, click on the [Add Firebase to your iOS app](http://d.pr/i/3sEL.png) and follow the steps from there to add the configuration file. You do _not_ need to set up a cocoapods project (this is already done through firestack). Make sure not to forget the `Copy Files` phase in iOS.
202202

203203
[Download the Firebase config file](https://support.google.com/firebase/answer/7015592) and place it in your app directory next to your app source code:
204204

205205
![GoogleService-Info.plist](http://d.pr/i/1eGev.png)
206206

207207
Once you download the configuration file, make sure you place it in the root of your Xcode project. Every different Bundle ID (aka, even different project variants needs their own configuration file).
208208

209-
Lastly, due to some dependencies requirements, Firestack supports iOS versions 8.0 and up. Make sure to update the minimum version of your iOS app to `8.0`.
209+
Lastly, due to some dependencies requirements, Firestack supports iOS versions 8.0 and up. Make sure to update the minimum version of your iOS app to `8.0`.
210210

211211
### Android
212212

@@ -369,15 +369,15 @@ We can use an external authentication provider, such as twitter/facebook for aut
369369
[Currently undergoing updates]
370370

371371
### socialLogin with custom Library
372-
If you don't want to use [react-native-oauth](https://github.com/fullstackreact/react-native-oauth), you can use other library such as [react-native-facebook-login](https://github.com/magus/react-native-facebook-login).
372+
If you don't want to use [react-native-oauth](https://github.com/fullstackreact/react-native-oauth), you can use other library such as [react-native-facebook-login](https://github.com/magus/react-native-facebook-login).
373373

374374
```javascript
375375
var {FBLogin, FBLoginManager} = require('react-native-facebook-login');
376376

377377
var Login = React.createClass({
378378
render: function() {
379379
return (
380-
<FBLogin
380+
<FBLogin
381381
onLogin={function(data){
382382
console.log("Logged in!");
383383
console.log(data);
@@ -641,7 +641,7 @@ And we also export the filetype constants as well:
641641
* FILETYPE_REGULAR
642642
* FILETYPE_DIRECTORY
643643

644-
> Note: this idea comes almost directory from [react-native-fs](https://github.com/johanneslumpe/react-native-fs), so we don't claim credit for coming up with this fantastic idea.
644+
> Note: this idea comes almost directory from [react-native-fs](https://github.com/johanneslumpe/react-native-fs), so we don't claim credit for coming up with this fantastic idea.
645645
646646
### Realtime Database
647647

@@ -651,6 +651,7 @@ Ranking strategy
651651

652652
Add a new record with timestamp using this solution:
653653

654+
```js
654655
firebaseApp.database.ref('posts').push().then((res) => {
655656
let newPostKey = res.key;
656657
firebaseApp.ServerValue.then(map => {
@@ -673,15 +674,18 @@ firebaseApp.database.ref('posts').push().then((res) => {
673674
})
674675
})
675676
})
677+
```
676678

677679
Then retrieve the feed using this:
678680

681+
```js
679682
firebaseApp.database.ref('posts').orderByChild('timestamp').limitToLast(30).once('value')
680683
.then((snapshot) => {
681684
this.props.savePosts(snapshot.val())
682685
const val = snapshot.val();
683686
console.log(val);
684687
})
688+
```
685689

686690
#### DatabaseRef
687691

@@ -719,7 +723,7 @@ For handling offline operations, you can enable persistence by using the `setPer
719723
firestack.database.setPersistence(true);
720724
```
721725

722-
The database refs has a `keepSynced()` function to tell the firestack library to keep the data at the `ref` in sync.
726+
The database refs has a `keepSynced()` function to tell the firestack library to keep the data at the `ref` in sync.
723727

724728
```javascript
725729
const ref = firestack.database
@@ -799,7 +803,7 @@ Monitor token generation
799803
firestack.cloudMessaging.listenForTokenRefresh(function (token) {
800804
console.log('refresh device token', token);
801805
});
802-
806+
803807
// remove listener
804808
firestack.cloudMessaging.unlistenForTokenRefresh();
805809
```
@@ -872,14 +876,14 @@ After the `npm` version is installed, you can either clone the repo directly int
872876
git clone https://github.com/fullstackreact/react-native-firestack.git ./node_modules/react-native-firestack
873877
```
874878

875-
Alternatively, you can clone the repo somewhere else and `rsync` the directory over to the `node_modules/` directory.
879+
Alternatively, you can clone the repo somewhere else and `rsync` the directory over to the `node_modules/` directory.
876880

877881
> This is the method I use as it allows me to separate the codebases:
878882
879883
```bash
880884
git clone https://github.com/fullstackreact/react-native-firestack.git \
881885
~/Development/react-native/mine/react-native-firestack/
882-
886+
883887
## And rsync
884888
rsync -avhW --delete \
885889
--exclude='node_modules' \

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /