You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+81-13Lines changed: 81 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -35,19 +35,21 @@ Clone the easy example Github repository.
35
35
36
36
#### Modify the project configurations
37
37
38
-
* You need to modify`appID` to your own account, which can be obtained in the [ZEGO Admin Console](https://console.zegocloud.com/).
39
-
*[Generate a Token on your app server (recommended)](https://docs.zegocloud.com/article/11648), provide an interface for the client to call and replace the generateToken method above.
38
+
* You need to set`appID` to your own account, which can be obtained in the [ZEGO Admin Console](https://console.zegocloud.com/).
39
+
*You need to set `serverUrl` to a valid URL that can be obtained for Zego auth token and post FCM notification request.
40
40
41
-
> If you are using Heroku for your backen service, you can deploy the token generation service by one click.
41
+
> We use Heroku for test backen service, you can deploy the token generation service with one simple click.
> Once done you will get an url for your instance, try accessing `https://<heroku url>/access_token?uid=1234` to check if it works.
45
+
> Once deployed completed, you will get an url for your instance, try accessing `https://<heroku url>/access_token?uid=1234` to check if it works.
46
46
>
47
-
> Check [dynamic_token_server_nodejs](https://github.com/ZEGOCLOUD/dynamic_token_server_nodejs) for more details.
47
+
> Check [easy_example_call_server_nodejs](https://github.com/ZEGOCLOUD/easy_example_call_server_nodejs) for more details.
48
+
>
49
+
> Note⚠️⚠️⚠️: There are some limitations for Heroku free account, please check this [Free Dyno Hours](https://devcenter.heroku.com/articles/free-dyno-hours) if you want to use Heroku for your production service.
48
50
49
51
50
-
> 
52
+
> 
51
53
52
54
#### Run on your device
53
55
1. For Android
@@ -92,23 +94,29 @@ The following will describe how to build your own project based on this project.
92
94
93
95
### Copy the source code
94
96
95
-
Copy the `ZegoExpressManager` folder、`img` folderand `App.tsx` files to your typescript project.
97
+
Copy the `ZegoExpressManager` folder,`img` folder, `pages` folder and `App.js` files to your project.
96
98
97
-
>
99
+
>
98
100
99
101
### Add dependencies to `package.json`
100
102
101
103
```json
102
104
"dependencies": {
103
-
"zego-express-engine-reactnative": "^0.17.3"
105
+
...
106
+
"@notifee/react-native": "^5.2.1",
107
+
"@react-native-firebase/app": "^14.9.2",
108
+
"@react-native-firebase/messaging": "^14.9.2",
109
+
"notifee": "^0.0.1",
110
+
"react-native-router-flux": "^4.3.1",
111
+
"zego-express-engine-reactnative": "^0.17.3",
104
112
}
105
113
```
106
114
### Grant permission
107
115
108
-
You need to grant the network access, camera, and microphone permission to make your APP work as except.
116
+
You need to grant the network access, camera, microphone and notification permission to make your APP work as except.
109
117
110
118
#### For iOS
111
-
>
119
+
>
112
120
```plist
113
121
<key>NSCameraUsageDescription</key>
114
122
<string>We need to use your camera to help you join the voice interaction.</string>
@@ -117,7 +125,7 @@ You need to grant the network access, camera, and microphone permission to make
We use [Firebase FCM](https://firebase.google.com/docs/cloud-messaging) for notification service and use [Notifee](https://notifee.app/) to display the notification content.
161
+
162
+
#### Setup FCM
163
+
164
+
1. Go to [Firebase Console](https://console.firebase.google.com/) and create new project if you don't have one.
165
+
2. Andd new `Android` app to your Firebase project. Download the `google-service.json` file and move it into your Android app module root directory.
166
+

167
+
3. Add the google-services plugin as a dependency inside of your `/android/build.gradle` file:
168
+

169
+
```xml
170
+
buildscript {
171
+
dependencies {
172
+
// ... other dependencies
173
+
classpath 'com.google.gms:google-services:4.3.10'
174
+
// Add me --- /\
175
+
}
176
+
}
177
+
```
178
+
4. Execute the plugin by adding the following to your `/android/app/build.gradle` file:
179
+

180
+
```xml
181
+
apply plugin: 'com.android.application'
182
+
apply plugin: 'com.google.gms.google-services' // <- Add this line
183
+
```
184
+
185
+
#### Setup Notifee
186
+
187
+
1. Add libs configuration for Notifee to your `/android/build.gradle` file:
188
+
```xml
189
+
allprojects {
190
+
repositories {
191
+
// ADD THIS BLOCK - this is how Notifee finds its Android library:
If you are using [Firebase Cloud Functions](https://firebase.google.com/docs/functions), check [this doc](https://firebase.google.com/docs/cloud-messaging/send-message#send-messages-to-specific-devices) for usage and check [this example code](https://github.com/ZEGOCLOUD/easy_example_call_server_nodejs/blob/master/index.js) to make the FCM work with your project.
0 commit comments