|
4 | 4 | See docs at https://docs.quickblox.com/docs/react-native-quick-start |
5 | 5 |
|
6 | 6 | ## Quick Start |
7 | | -This guide demonstarates how to connect quickblox-react-native-sdk to your project and start development. |
| 7 | +This guide demonstarates how to connect **quickblox-react-native-sdk** to your project and start development. |
8 | 8 |
|
9 | 9 | ### Create a new app in the Admin Panel |
10 | | -Quickblox application includes everything that brings messaging right into your application - chat, video calling, users, push notifications, etc. To create a QuickBlox application, follow the steps below: |
| 10 | +QuickBlox application includes everything that brings messaging right into your application - chat, video calling, users, push notifications, etc. To create a QuickBlox application, follow the steps below: |
11 | 11 |
|
12 | | -1. Register a new account. Type in your email and password to sign in. You can also sign in with your Google or Github accounts. |
| 12 | +1. Register a new account following [this link](https://admin.quickblox.com/signup). Type in your email and password to sign in. You can also sign in with your Google or Github accounts. |
13 | 13 | 2. Create the app clicking **New app** button. |
14 | 14 | 3. Configure the app. Type in the information about your organization into corresponding fields and click **Add** button. |
15 | | -4. Go to the screen with credentials. Locate **Credentials** groupbox and copy your **Application ID**, **Authorization Key**, and **Authorization Secret**. These data are needed to run your application on QuickBlox server. |
| 15 | +4. Go to **Dashboard** --> **Overview** --> **Credentials** groupbox and copy your **Application ID**, **Authorization Key**, **Authorization Secret**, and **Account Key**. |
16 | 16 |
|
17 | 17 | ### Install React Native SDK into your app |
18 | | -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: |
| 18 | +To connect QuickBlox to your app just add it into your dependencies in `package.json` - to do so, in the root directory of the project execute the following command in terminal: |
19 | 19 |
|
20 | 20 | `npm install quickblox-react-native-sdk --save` |
21 | 21 |
|
22 | | -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. |
| 22 | +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 command in terminal: |
23 | 23 |
|
24 | 24 | `pod install` |
25 | 25 |
|
@@ -102,24 +102,14 @@ QB.chat |
102 | 102 | occupantsIds: [12345] |
103 | 103 | }) |
104 | 104 | .then(function (dialog) { |
105 | | - // handle as necessary, i.e. |
106 | | - // subscribe to chat events, typing events, etc. |
| 105 | + // handle as necessary |
107 | 106 | }) |
108 | 107 | .catch(function (e) { |
109 | 108 | // handle error |
110 | 109 | }); |
111 | 110 | ``` |
112 | 111 |
|
113 | | -#### Subscribe to receive messages |
114 | | - |
115 | | -QuickBlox provides message event handler allowing to notify client apps of events that happen on the chat. Thus, when a dialog has been created, a user can subscribe to receive notifications about new incoming messages. To subscribe to message events call `QB.chat.subscribeMessageEvents` method and pass `dialogId` parameter to it using the following code snippet. The `QB.chat.subscribeMessageEvents` method tells SDK to send events about new messages. |
116 | | - |
117 | | -```javascript |
118 | | -QB.chat |
119 | | - .subscribeMessageEvents({ dialogId: 'dsfsd934329hjhkda98793j2' }) |
120 | | - .then(function () { }) |
121 | | - .catch(function (e) { /* handle error */ }); |
122 | | -``` |
| 112 | +#### Receive messages |
123 | 113 |
|
124 | 114 | To receive new messages, assign event handler using the code snippet below: |
125 | 115 |
|
|
0 commit comments