mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-20 10:42:18 +08:00
Android & flutter
This commit is contained in:
@ -22,7 +22,9 @@ rootProject.allprojects {
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
// useLibrary 'org.apache.http.legacy'
|
||||||
|
|
||||||
resourcePrefix 'tencent_kit'
|
resourcePrefix 'tencent_kit'
|
||||||
|
|
||||||
|
BIN
android/libs/open_sdk_3.5.10.3_r593ae92_lite.jar
Normal file
BIN
android/libs/open_sdk_3.5.10.3_r593ae92_lite.jar
Normal file
Binary file not shown.
Binary file not shown.
@ -183,6 +183,15 @@ public class TencentKitPlugin implements FlutterPlugin, ActivityAware, ActivityR
|
|||||||
tencent = Tencent.createInstance(appId, applicationContext);
|
tencent = Tencent.createInstance(appId, applicationContext);
|
||||||
}
|
}
|
||||||
result.success(null);
|
result.success(null);
|
||||||
|
} else if ("setIsPermissionGranted".equals(call.method)) {
|
||||||
|
final boolean granted = call.argument("granted");
|
||||||
|
final String buildModel = call.argument("build_model");
|
||||||
|
if (!TextUtils.isEmpty(buildModel)) {
|
||||||
|
Tencent.setIsPermissionGranted(granted, buildModel);
|
||||||
|
} else {
|
||||||
|
Tencent.setIsPermissionGranted(granted);
|
||||||
|
}
|
||||||
|
result.success(null);
|
||||||
} else if (METHOD_ISQQINSTALLED.equals(call.method)) {
|
} else if (METHOD_ISQQINSTALLED.equals(call.method)) {
|
||||||
result.success(isAppInstalled(applicationContext, "com.tencent.mobileqq"));
|
result.success(isAppInstalled(applicationContext, "com.tencent.mobileqq"));
|
||||||
} else if (METHOD_ISTIMINSTALLED.equals(call.method)) {
|
} else if (METHOD_ISTIMINSTALLED.equals(call.method)) {
|
||||||
|
2
android/src/vendor/AndroidManifest.xml
vendored
2
android/src/vendor/AndroidManifest.xml
vendored
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.tencent.connect.common.AssistActivity"
|
android:name="com.tencent.connect.common.AssistActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:screenOrientation="behind"
|
android:screenOrientation="behind"
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||||
</application>
|
</application>
|
||||||
|
@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
|
|||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion flutter.compileSdkVersion
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
disable 'InvalidPackage'
|
disable 'InvalidPackage'
|
||||||
@ -34,8 +34,8 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "io.github.v7lin.tencent_kit_example"
|
applicationId "io.github.v7lin.tencent_kit_example"
|
||||||
minSdkVersion 16
|
minSdkVersion flutter.minSdkVersion
|
||||||
targetSdkVersion 28
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ packages:
|
|||||||
name: analyzer
|
name: analyzer
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.1"
|
version: "1.7.2"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -35,7 +35,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -105,14 +105,14 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -304,14 +304,14 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.7.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -533,7 +533,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.4.3"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -561,7 +561,7 @@ packages:
|
|||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -605,5 +605,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.24.0-10"
|
flutter: ">=1.24.0-10"
|
||||||
|
@ -78,6 +78,20 @@ class Tencent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 设置是否已授权获取设备信息
|
||||||
|
Future<void> setIsPermissionGranted({
|
||||||
|
required bool granted,
|
||||||
|
String? buildModel,
|
||||||
|
}) {
|
||||||
|
return _channel.invokeMethod(
|
||||||
|
'setIsPermissionGranted',
|
||||||
|
<String, dynamic>{
|
||||||
|
'granted': granted,
|
||||||
|
if (buildModel?.isNotEmpty ?? false) 'build_model': buildModel,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
Stream<BaseResp> respStream() {
|
Stream<BaseResp> respStream() {
|
||||||
return _respStreamController.stream;
|
return _respStreamController.stream;
|
||||||
|
16
pubspec.lock
16
pubspec.lock
@ -28,7 +28,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -98,14 +98,14 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -262,14 +262,14 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.7.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -393,7 +393,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.4.3"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -414,7 +414,7 @@ packages:
|
|||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -437,5 +437,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.20.0"
|
flutter: ">=1.20.0"
|
||||||
|
Reference in New Issue
Block a user