Skip to content

Commit e558d33

Browse files
authored
增加APP拉起客服微信对应文档 (#713)
增加APP拉起客服微信对应文档,及示例代码
1 parent b9b553e commit e558d33

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- Subscribe Message.
3333
- Just open WeChat app.
3434
- Launch app From wechat link.
35+
- Open Customer Service
3536

3637
## Preparation
3738

@@ -125,6 +126,7 @@ It' better to register your API as early as possible.
125126
- [Payment](./doc/PAYMENT.md)
126127
- [Auth](./doc/AUTH.md)
127128
- [Launch app from h5](./doc/LAUNCH_APP_FROM_H5.md)
129+
- [Open Customer Service](/doc/Customer_Service.md)
128130

129131
For more capabilities, you can read the public functions of `fluwx`.
130132

README_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- 订阅消息.
3131
- 打开微信.
3232
- 从微信标签打开应用
33+
- APP拉起客服微信
3334

3435
## 准备
3536

@@ -122,6 +123,7 @@ fluwx.registerApi(appId: "wxd930ea5d5a228f5f",universalLink: "https://your.unive
122123
- [支付](./doc/PAYMENT_CN.md)
123124
- [登录](./doc/AUTH_CN.md)
124125
- [从微信标签打开应用](./doc/LAUNCH_APP_FROM_H5_CN.md)
126+
- [APP拉起客服微信](/doc/Customer_Service_CN.md)
125127
对于更多功能,可以查看源码。
126128

127129
## QA

doc/Customer_Service.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Open Customer Service
2+
3+
4+
```
5+
static Fluwx _fluwx = Fluwx();
6+
static Future<void> openCustomerServiceChat() async {
7+
bool isInstall = await _fluwx.isWeChatInstalled;
8+
if (!isInstall) {
9+
if (Platform.isIOS) {
10+
jumpToAppStore();
11+
} else {
12+
EasyLoading.showToast("UnInstall");
13+
}
14+
return;
15+
}
16+
CustomerServiceChat chat = CustomerServiceChat(
17+
corpId: "wwdxxxxxx",
18+
url: "https://work.weixin.qq.com/kfid/kfcxxxxxx");
19+
_fluwx.open(target: chat);
20+
}
21+
jumpToAppStore() async {
22+
final uri = Uri.parse('https://apps.apple.com/app/id414478124');
23+
if (await canLaunchUrl(uri)) {
24+
await launchUrl(uri);
25+
}
26+
}
27+
```

doc/Customer_Service_CN.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# 打开客服微信
3+
4+
5+
```
6+
static Fluwx _fluwx = Fluwx();
7+
static Future<void> openCustomerServiceChat() async {
8+
bool isInstall = await _fluwx.isWeChatInstalled;
9+
if (!isInstall) {
10+
if (Platform.isIOS) {
11+
jumpToAppStore();
12+
} else {
13+
EasyLoading.showToast("UnInstall");
14+
}
15+
return;
16+
}
17+
CustomerServiceChat chat = CustomerServiceChat(
18+
corpId: "wwdxxxxxx",
19+
url: "https://work.weixin.qq.com/kfid/kfcxxxxxx");
20+
_fluwx.open(target: chat);
21+
}
22+
jumpToAppStore() async {
23+
final uri = Uri.parse('https://apps.apple.com/app/id414478124');
24+
if (await canLaunchUrl(uri)) {
25+
await launchUrl(uri);
26+
}
27+
}
28+
```

0 commit comments

Comments
 (0)