Skip to content

Commit 0d8039c

Browse files
author
oleksandr-shvetsov-qb
authored
Fixed formatting of README
1 parent 6f56887 commit 0d8039c

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

README.md

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# QuickBlox React Native SDK
22

3-
## Quic Start
3+
## Quick Start
44
This guide demonstarates how to connect quickblox-react-native-sdk to your project and start development.
55

66
### Create a new app in the Admin Panel
@@ -14,7 +14,7 @@ Quickblox application includes everything that brings messaging right into your
1414
### Install React Native SDK into your app
1515
To connect QuickBlox to your app just add it into your `package.json` in the root directory of the project and enter the following code snippet:
1616

17-
`npm install quickblox-react-native-sdk`
17+
`npm install quickblox-react-native-sdk --save`
1818

1919
iOS and Android have different dependencies systems. For that reason, you need to install dependencies in your iOS project. Just locate **ios/** folder in the root directory of the project and enter the following code snippet.
2020

@@ -27,22 +27,22 @@ Initialize the framework with your application credentials. Pass `appId`, `authK
2727

2828
```javascript
2929
const appSettings = {
30-
appId: '',
31-
authKey: '',
32-
authSecret: '',
33-
accountKey: '',
34-
apiEndpoint: '', // optional
35-
chatEndpoint: '' // optional
30+
appId: '',
31+
authKey: '',
32+
authSecret: '',
33+
accountKey: '',
34+
apiEndpoint: '', // optional
35+
chatEndpoint: '' // optional
3636
};
3737

3838
QB.settings
39-
.init(appSettings)
40-
.then(function () {
41-
// SDK initialized successfully
42-
})
43-
.catch(function (e) {
44-
// Some error occured, look at the exception message for more details
45-
});
39+
.init(appSettings)
40+
.then(function () {
41+
// SDK initialized successfully
42+
})
43+
.catch(function (e) {
44+
// Some error occured, look at the exception message for more details
45+
});
4646
```
4747

4848
#### Authorize user
@@ -51,18 +51,18 @@ In order to use the abilities of QuickBlox SDK, you need to authorize your app o
5151

5252
```javascript
5353
QB.auth
54-
.login({
55-
login: 'yourlogin',
56-
password: 'yourpassword'
57-
})
58-
.then(function (info) {
59-
// signed in successfully, handle info as necessary
60-
// info.user - user information
61-
// info.session - current session
62-
})
63-
.catch(function (e) {
64-
// handle error
65-
});
54+
.login({
55+
login: 'yourlogin',
56+
password: 'yourpassword'
57+
})
58+
.then(function (info) {
59+
// signed in successfully, handle info as necessary
60+
// info.user - user information
61+
// info.session - current session
62+
})
63+
.catch(function (e) {
64+
// handle error
65+
});
6666
```
6767

6868
**Note!**
@@ -94,17 +94,17 @@ Let’s create **1-1 dialog**. Call `QB.chat.createDialog` method and pass `QB.c
9494

9595
```javascript
9696
QB.chat
97-
.createDialog({
98-
type: QB.chat.DIALOG_TYPE.CHAT,
99-
occupantsIds: [12345]
100-
})
101-
.then(function (dialog) {
102-
// handle as necessary, i.e.
103-
// subscribe to chat events, typing events, etc.
104-
})
105-
.catch(function (e) {
106-
// handle error
107-
});
97+
.createDialog({
98+
type: QB.chat.DIALOG_TYPE.CHAT,
99+
occupantsIds: [12345]
100+
})
101+
.then(function (dialog) {
102+
// handle as necessary, i.e.
103+
// subscribe to chat events, typing events, etc.
104+
})
105+
.catch(function (e) {
106+
// handle error
107+
});
108108
```
109109

110110
#### Subscribe to receive messages
@@ -113,22 +113,22 @@ QuickBlox provides message event handler allowing to notify client apps of event
113113

114114
```javascript
115115
QB.chat
116-
.subscribeMessageEvents({ dialogId: 'dsfsd934329hjhkda98793j2' })
117-
.then(function () { })
118-
.catch(function (e) { /* handle error */ });
116+
.subscribeMessageEvents({ dialogId: 'dsfsd934329hjhkda98793j2' })
117+
.then(function () { })
118+
.catch(function (e) { /* handle error */ });
119119
```
120120

121121
To receive new messages, assign event handler using the code snippet below:
122122

123123
```javascript
124124
const emitter = Platform.select({
125-
android: DeviceEventEmitter,
126-
ios: new NativeEventEmitter(QB.chat)
125+
android: DeviceEventEmitter,
126+
ios: new NativeEventEmitter(QB.chat)
127127
})
128128
emitter.addListener(QB.chat.EVENT_TYPE.MESSAGE.RECEIVED_NEW_MESSAGE, event => {
129-
const { type, payload } = event
130-
// type - type of the event (string)
131-
// payload - new message (object)
129+
const { type, payload } = event
130+
// type - type of the event (string)
131+
// payload - new message (object)
132132
})
133133
```
134134

@@ -138,15 +138,15 @@ When a dialog is created, a user can send a message. To create and send your fir
138138

139139
```javascript
140140
const message = {
141-
dialogId: 'dsfsd934329hjhkda98793j2',
142-
body: 'Hey there!',
143-
saveToHistory: true
141+
dialogId: 'dsfsd934329hjhkda98793j2',
142+
body: 'Hey there!',
143+
saveToHistory: true
144144
};
145145

146146
QB.chat
147-
.sendMessage(message)
148-
.then(function () { /* send successfully */ })
149-
.catch(function (e) { /* handle error */ })
147+
.sendMessage(message)
148+
.then(function () { /* send successfully */ })
149+
.catch(function (e) { /* handle error */ })
150150
```
151151

152152
## LICENSE

0 commit comments

Comments
 (0)