Skip to content

Commit 21fcc33

Browse files
committed
Initial commit with latest code
0 parents  commit 21fcc33

File tree

581 files changed

+45285
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

581 files changed

+45285
-0
lines changed

CONFIGKEY.md

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
# Common Function Configuration Guide
3+
4+
- [Offline push](#offlinepush)
5+
- [Map](#map)
6+
7+
## Offlinepush
8+
9+
Currently using the integrated solution.
10+
11+
### Client configuration
12+
13+
#### 1. Use Getui (https://getui.com/) in mainland China
14+
15+
###### Configure iOS and Android in the integration guide of Getui
16+
17+
**iOS platform configuration:**
18+
According to [its documentation](https://docs.getui.com/getui/mobile/ios/overview/), make the corresponding iOS configuration. Then find the following files in the code and modify the corresponding iOS side key:
19+
20+
- **[push_controller.dart](openim_common/lib/src/controller/push_controller.dart)**
21+
22+
```dart
23+
const appID = 'your-app-id';
24+
const appKey = 'your-app-key';
25+
const appSecret = 'your-app-secret';
26+
```
27+
28+
**Android platform configuration:**
29+
According to [its documentation](https://docs.getui.com/getui/mobile/android/overview/), make corresponding Android configurations, and pay attention to [multi-vendor](https://docs.getui.com/getui/mobile/vendor/vendor_open/) configurations. Then modify the following file contents:
30+
31+
- **[build.gradle](android/app/build.gradle)**
32+
33+
```gradle
34+
manifestPlaceholders = [
35+
GETUI_APPID : "",
36+
XIAOMI_APP_ID : "",
37+
XIAOMI_APP_KEY : "",
38+
MEIZU_APP_ID : "",
39+
MEIZU_APP_KEY : "",
40+
HUAWEI_APP_ID : "",
41+
OPPO_APP_KEY : "",
42+
OPPO_APP_SECRET: "",
43+
VIVO_APP_ID : "",
44+
VIVO_APP_KEY : "",
45+
HONOR_APP_ID : "",
46+
]
47+
```
48+
49+
#### 2. Use [FCM (Firebase Cloud Messaging)](https://firebase.google.com/docs/cloud-messaging) in overseas regions
50+
51+
According to the integration guide of [FCM](https://firebase.google.com/docs/cloud-messaging), replace the following files:
52+
53+
- **[google-services.json](android/app/google-services.json)** (Android platform)
54+
- **[GoogleService-Info.plist](ios/Runner/GoogleService-Info.plist)** (iOS platform)
55+
- **[firebase_options.dart](openim_common/lib/src/controller/firebase_options.dart)** (Firebase configuration in Dart project)
56+
57+
### Offline push banner settings
58+
59+
Currently, the SDK is designed to directly control the display content of the push banner by the client. When sending a message, set the input parameter [offlinePushInfo](https://github.com/openimsdk/openim-flutter-demo/blob/cc72b6d7ca5f70ca07885857beecec512f904f8c/lib/pages/chat/chat_logic.dart#L543):
60+
61+
```dart
62+
final offlinePushInfo = OfflinePushInfo(
63+
title: "Fill in the title",
64+
desc: "Fill in the description, such as the message content",
65+
iOSBadgeCount: true,
66+
);
67+
// If you do not customize offlinePushInfo, the title defaults to the app name, and the desc defaults to "You received a new message"
68+
```
69+
70+
According to actual needs, you can enable the offline push function after completing the corresponding client and server configurations.
71+
72+
---
73+
74+
## Map
75+
76+
### Configuration Guide
77+
78+
Need to configure the corresponding AMap Key. Please refer to [AMap Document](https://lbs.amap.com/) for details. The code in the project needs to modify the following Key:
79+
80+
- **[webKey](https://github.com/openimsdk/openim-flutter-demo/blob/5720a10a31a0a9bc5319775f9f4da83d6996dbfe/openim_common/lib/src/config.dart#L49)**
81+
- **[webServerKey](https://github.com/openimsdk/openim-flutter-demo/blob/5720a10a31a0a9bc5319775f9f4da83d6996dbfe/openim_common/lib/src/config.dart#L50)**
82+
83+
```dart
84+
static const webKey = 'webKey';
85+
static const webServerKey = 'webServerKey';
86+
```
87+
88+
Once the configuration is complete, you can enable the map function.

CONFIGKEY.zh-CN.md

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
# 常见功能配置指南
3+
4+
- [离线推送功能](#离线推送功能)
5+
- [地图功能](#地图功能)
6+
7+
## 离线推送功能
8+
9+
目前使用的是集成方案。
10+
11+
### 客户端配置
12+
13+
#### 1. 中国大陆地区使用个推([Getui](https://getui.com/)
14+
15+
###### [Getui](https://getui.com/)的集成指南,配置iOS和Android。
16+
17+
**iOS 平台配置:**
18+
根据[其文档](https://docs.getui.com/getui/mobile/ios/overview/)做好相应的iOS配置。然后在代码中找到以下文件并修改对应的 iOS侧Key:
19+
20+
- **[push_controller.dart](openim_common/lib/src/controller/push_controller.dart)**
21+
22+
```dart
23+
const appID = 'your-app-id';
24+
const appKey = 'your-app-key';
25+
const appSecret = 'your-app-secret';
26+
```
27+
28+
**Android 平台配置:**
29+
根据[其文档](https://docs.getui.com/getui/mobile/android/overview/)做好相应的Android配置,注意[多厂商](https://docs.getui.com/getui/mobile/vendor/vendor_open/)配置。然后修改以下文件内容:
30+
31+
- **[build.gradle](android/app/build.gradle)**
32+
33+
```gradle
34+
manifestPlaceholders = [
35+
GETUI_APPID : "",
36+
XIAOMI_APP_ID : "",
37+
XIAOMI_APP_KEY : "",
38+
MEIZU_APP_ID : "",
39+
MEIZU_APP_KEY : "",
40+
HUAWEI_APP_ID : "",
41+
OPPO_APP_KEY : "",
42+
OPPO_APP_SECRET: "",
43+
VIVO_APP_ID : "",
44+
VIVO_APP_KEY : "",
45+
HONOR_APP_ID : "",
46+
]
47+
```
48+
49+
#### 2. 海外地区使用 [FCM(Firebase Cloud Messaging)](https://firebase.google.com/docs/cloud-messaging)
50+
51+
根据 [FCM](https://firebase.google.com/docs/cloud-messaging) 的集成指南,替换以下文件:
52+
53+
- **[google-services.json](android/app/google-services.json)**(Android 平台)
54+
- **[GoogleService-Info.plist](ios/Runner/GoogleService-Info.plist)**(iOS 平台)
55+
- **[firebase_options.dart](openim_common/lib/src/controller/firebase_options.dart)**(Dart 项目中的 Firebase 配置)
56+
57+
### 离线推送横幅设置
58+
59+
目前SDK的设计是直接由客户端控制推送横幅的展示内容。发送消息时,设置入参[offlinePushInfo](https://github.com/openimsdk/openim-flutter-demo/blob/cc72b6d7ca5f70ca07885857beecec512f904f8c/lib/pages/chat/chat_logic.dart#L543)
60+
61+
```dart
62+
final offlinePushInfo = OfflinePushInfo(
63+
title: "填写标题",
64+
desc: "填写描述信息,例如消息内容",
65+
iOSBadgeCount: true,
66+
);
67+
// 如果不自定义offlinePushInfo,则title默认为app名称,desc默认为为“你收到了一条新消息”
68+
```
69+
70+
根据实际需求,完成对应的客户端和服务端配置后即可启用离线推送功能。
71+
72+
---
73+
74+
## 地图功能
75+
76+
### 配置指南
77+
78+
需要配置对应的 AMap Key。具体请参考 [AMap 文档](https://lbs.amap.com/),工程中的代码需要修改以下 Key:
79+
80+
- **[webKey](https://github.com/openimsdk/openim-flutter-demo/blob/5720a10a31a0a9bc5319775f9f4da83d6996dbfe/openim_common/lib/src/config.dart#L49)**
81+
- **[webServerKey](https://github.com/openimsdk/openim-flutter-demo/blob/5720a10a31a0a9bc5319775f9f4da83d6996dbfe/openim_common/lib/src/config.dart#L50)**
82+
83+
```dart
84+
static const webKey = 'webKey';
85+
static const webServerKey = 'webServerKey';
86+
```
87+
88+
完成配置后即可启用地图功能。

LICENSE

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
OpenIM Open Source License
2+
This repository is licensed under the GNU Affero General Public License version 3 (AGPL-3.0) and is subject to the following additional terms:
3+
1. Commercial Use
4+
1.1 Prohibition of Commercial Use
5+
This repository and its contents may not be used for any commercial purposes. If you wish to use OpenIM for commercial purposes, you must obtain a commercial license from the producer.
6+
1.2 Commercial License Application
7+
For commercial licensing, please contact [email protected]. Commercial licenses will be tailored to your specific needs and use cases to ensure that you use OpenIM legally and compliantly.
8+
1.3 License After Commercial Authorization
9+
If you have paid the relevant commercial licensing fees to the producer, you may use OpenIM in accordance with the terms of the commercial license without adhering to the provisions of AGPL-3.0. The commercial license grants you the rights to use, modify, and distribute OpenIM under specific conditions detailed in the commercial licensing agreement.
10+
2. LOGO and Copyright Information
11+
2.1 Protection of LOGO and Copyright Information
12+
During the use of this repository, you may not remove, modify, or hide the LOGO or copyright information within the OpenIM console or applications.
13+
2.2 LOGO Definition
14+
All unified text or icons bearing the words OpenIM or OpenIMSDK within the user interfaces of this repository are collectively referred to as the LOGO. This includes, but is not limited to, textual and iconographic identifiers in software interfaces, documentation, and promotional materials.
15+
3. Contributor Agreement
16+
As a contributor, you agree to the following terms:
17+
3.1 Right to Adjust the Agreement
18+
The producer reserves the right to adjust the strictness or leniency of the open-source agreement as necessary to ensure that the agreement aligns with the development and needs of the project.
19+
3.2 Commercial Use of Code
20+
The code you contribute may be used for commercial purposes, including but not limited to cloud business operations. By contributing, you agree that the producer has the right to use your contributions for commercial purposes without additional compensation or authorization.
21+
4. Other Terms
22+
4.1 Compliance with AGPL-3.0
23+
Except for the specific conditions mentioned above, all other rights and restrictions are governed by the GNU Affero General Public License version 3 (AGPL-3.0). For detailed information about the AGPL-3.0 license, please refer to the GNU AGPL-3.0 License.
24+
4.2 Patent Protection
25+
The interactive design of this product is protected by design patents. Any unauthorized copying, modification, or distribution of the interactive design constitutes infringement and will be subject to legal action.
26+
5. Disclaimer
27+
This software is provided "as is," without any form of express or implied warranty, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. Users assume all risks associated with the use of this software.
28+
6. Contact Information
29+
For any licensing-related questions or to obtain a commercial license, please contact [email protected].
30+
31+
GNU Affero General Public License Version 3 (AGPL-3.0)
32+
© 2024 OpenIMSDK
33+
34+
This program is free software: you can redistribute it and/or modify
35+
it under the terms of the GNU Affero General Public License as
36+
published by the Free Software Foundation, either version 3 of the
37+
License, or (at your option) any later version.
38+
39+
This program is distributed in the hope that it will be useful,
40+
but WITHOUT ANY WARRANTY; without even the implied warranty of
41+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42+
GNU Affero General Public License for more details.
43+
44+
You should have received a copy of the GNU Affero General Public License
45+
along with this program. If not, see <https://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)