Skip to content

Commit d30fdd9

Browse files
authored
Merge branch 'master' into master
2 parents d56cb20 + 9358efe commit d30fdd9

File tree

14 files changed

+112
-107
lines changed

14 files changed

+112
-107
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/setup-java@v2
4646
with:
4747
distribution: 'zulu'
48-
java-version: '11'
48+
java-version: '17'
4949
- uses: subosito/flutter-action@v2
5050
with:
5151
channel: 'stable'

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.2.0
2+
3+
* HarmonyOS: 升级 QQ SDK 到 v1.0.3, 优化文档
4+
15
## 6.1.0
26

37
* 新增: 对 `HarmonyOS` 的支持, 受限于 SDK, 仅支持部分功能

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ https://${your applinks domain}/universal_link/${example_app}/qq_conn/${appId}
7272
7373
### HarmonyOS
7474

75-
> 当前在 `HarmonyOS` 平台, 仅支持 `setIsPermissionGranted/registerApp/isQQInstalled/loginServerSide`
76-
>
77-
> 由于 SDK 限制,当前仅支持 Server-Side 模式登录,auth code 在 accessToken 字段,获取后可自行在后端使用
75+
* 当前在 `HarmonyOS` 平台, 仅支持 `setIsPermissionGranted/registerApp/isQQInstalled/loginServerSide`
76+
* 由于 SDK 限制,当前仅支持 Server-Side 模式登录,请调用 `loginServerSide` 方法登录, 支持拉起 App 授权或 H5 授权 (qrcode 为 true 即可)
77+
* 为了 API 统一, Server-Side 模式授权返回的 auth code 存储在 `TencentLoginResp.accessToken` (不要当成客户端的 token 使用)
78+
* 详情阅读官方文档: [harmonyos_sdk 环境搭建](https://wiki.connect.qq.com/harmonyos_sdk%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba), 并阅读最后的说明
79+
* 关于在后端使用 code 换取 access_token 的问题, 请参考官方文档: [通过Authorization Code获取Access Token](https://wiki.connect.qq.com/%E4%BD%BF%E7%94%A8authorization_code%E8%8E%B7%E5%8F%96access_token#:~:text=Step2%EF%BC%9A%E9%80%9A%E8%BF%87Authorization%20Code%E8%8E%B7%E5%8F%96Access%20Token) , `redirect_uri` 一般为 `auth://tauth.qq.com/`
7880

7981
项目中 module.json5 的 "module" 节点下配置 querySchemes
8082

example/android/app/build.gradle

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,33 +12,14 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
22-
}
23-
24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2815
android {
2916
namespace "io.github.v7lin.tencent_kit_example"
3017
compileSdkVersion flutter.compileSdkVersion
3118
ndkVersion flutter.ndkVersion
3219

3320
compileOptions {
34-
sourceCompatibility JavaVersion.VERSION_1_8
35-
targetCompatibility JavaVersion.VERSION_1_8
21+
sourceCompatibility JavaVersion.VERSION_17
22+
targetCompatibility JavaVersion.VERSION_17
3623
}
3724

3825
defaultConfig {
@@ -42,8 +29,8 @@ android {
4229
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
4330
minSdkVersion flutter.minSdkVersion
4431
targetSdkVersion flutter.targetSdkVersion
45-
versionCode flutterVersionCode.toInteger()
46-
versionName flutterVersionName
32+
versionCode flutter.versionCode
33+
versionName flutter.versionName
4734
}
4835

4936
buildTypes {

example/android/build.gradle

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
@@ -28,4 +15,4 @@ subprojects {
2815

2916
tasks.register("clean", Delete) {
3017
delete rootProject.buildDir
31-
}
18+
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
21+
id "com.android.application" version "8.3.1" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
23+
}
24+
25+
include ':app'

example/ohos/build-profile.json5

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
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-
161
{
172
"app": {
183
"signingConfigs": [],
@@ -21,7 +6,7 @@
216
"name": "default",
227
"signingConfig": "default",
238
"compatibleSdkVersion": "5.0.0(12)",
24-
"runtimeOS": "HarmonyOS",
9+
"runtimeOS": "HarmonyOS"
2510
}
2611
]
2712
},
@@ -39,14 +24,17 @@
3924
]
4025
},
4126
{
42-
name: "tencent_kit",
43-
srcPath: "../../ohos",
44-
targets: [
45-
{
46-
name: "default",
47-
applyToProducts: ["default"],
48-
},
49-
],
50-
},
27+
"tencent_kit": {
28+
"srcPath": "../../ohos",
29+
"targets": [
30+
{
31+
"name": "default",
32+
"applyToProducts": [
33+
"default"
34+
]
35+
}
36+
]
37+
}
38+
}
5139
]
5240
}
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
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-
161
{
172
"name": "entry",
183
"version": "1.0.0",
@@ -21,7 +6,6 @@
216
"author": "",
227
"license": "",
238
"dependencies": {
24-
"tencent_kit": "../../../ohos"
25-
},
26-
}
27-
9+
"tencent_kit": "../../../ohos",
10+
}
11+
}

ios/Classes/UIApplication+Hook.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#import <UIKit/UIKit.h>
2+
3+
@interface UIApplication (Hook)
4+
@end

0 commit comments

Comments
 (0)