Skip to content

Commit a37c68a

Browse files
authored
Add impl for WeChat on HarmonyOS (#153)
Signed-off-by: yeliulee <yeliuleet@gmail.com>
1 parent ecdec65 commit a37c68a

Some content is hidden

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

44 files changed

+1129
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.1.0
2+
3+
* 新增对 OpenHarmony 的支持
4+
15
## 6.0.2
26

37
* 配置 Android 命名空间

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@ https://${your applinks domain}/universal_link/${example_app}/wechat/
106106

107107
> ⚠️ 很多 SDK 都会用到 universal_link,可为不同 SDK 分配不同的 path 以作区分
108108
109+
### OpenHarmony / HarmonyOS
110+
111+
> 当前 OpenHarmony 的微信 SDK 仅支持部分 API, 使用过程中请自行查阅文档
112+
113+
为了检查是否安装了微信,请在项目的 module.json5 文件中添加以下 scheme
114+
115+
```json5
116+
{
117+
"module": {
118+
"querySchemes": [
119+
"weixin"
120+
],
121+
}
122+
}
123+
```
124+
109125
### Flutter
110126

111127
* 配置

example/ohos/.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/node_modules
2+
/oh_modules
3+
/local.properties
4+
/.idea
5+
**/build
6+
/.hvigor
7+
.cxx
8+
/.clangd
9+
/.clang-format
10+
/.clang-tidy
11+
**/.test
12+
*.har
13+
**/BuildProfile.ets
14+
**/oh-package-lock.json5
15+
16+
**/src/main/resources/rawfile/flutter_assets/
17+
**/libs/arm64-v8a/libapp.so
18+
**/libs/arm64-v8a/libflutter.so
19+
**/libs/arm64-v8a/libvmservice_snapshot.so

example/ohos/AppScope/app.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"app": {
3+
"bundleName": "io.github.v7lin.wechat_kit_example",
4+
"vendor": "example",
5+
"versionCode": 1000000,
6+
"versionName": "1.0.0",
7+
"icon": "$media:app_icon",
8+
"label": "$string:app_name"
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"string": [
3+
{
4+
"name": "app_name",
5+
"value": "wechat_kit_example"
6+
}
7+
]
8+
}
6.63 KB
Loading

example/ohos/build-profile.json5

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
{
17+
"app": {
18+
"signingConfigs": [],
19+
"products": [
20+
{
21+
"name": "default",
22+
"signingConfig": "default",
23+
"compatibleSdkVersion": "5.0.0(12)",
24+
"runtimeOS": "HarmonyOS",
25+
}
26+
]
27+
},
28+
"modules": [
29+
{
30+
"name": "entry",
31+
"srcPath": "./entry",
32+
"targets": [
33+
{
34+
"name": "default",
35+
"applyToProducts": [
36+
"default"
37+
]
38+
}
39+
]
40+
},
41+
{
42+
"name": "wechat_kit",
43+
"srcPath": "../../ohos",
44+
"targets": [
45+
{
46+
"name": "default",
47+
"applyToProducts": [
48+
"default"
49+
]
50+
}
51+
]
52+
}
53+
]
54+
}

example/ohos/entry/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
/node_modules
3+
/oh_modules
4+
/.preview
5+
/build
6+
/.cxx
7+
/.test
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
{
17+
"apiType": 'stageMode',
18+
"buildOption": {
19+
},
20+
"targets": [
21+
{
22+
"name": "default",
23+
"runtimeOS": "HarmonyOS"
24+
},
25+
{
26+
"name": "ohosTest",
27+
}
28+
]
29+
}

example/ohos/entry/hvigorfile.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
17+
export { hapTasks } from '@ohos/hvigor-ohos-plugin';

0 commit comments

Comments
 (0)