mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-20 10:42:18 +08:00
修正适配 Android Q 本地分享 & TIM/QQLite
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 1.0.4 - 2019.12.16
|
||||||
|
|
||||||
|
* 适配 Android Q 本地分享适配(别问为什么,腾讯有毒!)
|
||||||
|
|
||||||
## 1.0.3 - 2019.12.05
|
## 1.0.3 - 2019.12.05
|
||||||
|
|
||||||
* 升级 Android SDK
|
* 升级 Android SDK
|
||||||
|
@ -47,6 +47,15 @@ android {
|
|||||||
# 混淆已打入 Library,随 Library 引用,自动添加到 apk 打包混淆
|
# 混淆已打入 Library,随 Library 引用,自动添加到 apk 打包混淆
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
<!-- 腾讯有毒吧,文档都不写,SDK里居然写死 android:authorities 为 com.tencent.tauth.fileprovider,而非不同应用不同 android:authorities -->
|
||||||
|
<manifest>
|
||||||
|
<!-- targetSdkVersion >= 29, 豁免 Android Q 的外部存储沙箱限制 -->
|
||||||
|
<application android:requestLegacyExternalStorage="true">
|
||||||
|
</application>
|
||||||
|
</manifest>
|
||||||
|
```
|
||||||
|
|
||||||
## ios
|
## ios
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||||
|
|
||||||
<!-- Android Q 的外部存储沙箱限制 -->
|
<!-- Android Q 的外部存储沙箱限制 -->
|
||||||
<!-- 腾讯有毒吧,文档都不写 -->
|
<!-- 腾讯有毒吧,文档都不写,SDK里居然写死 android:authorities 为 com.tencent.tauth.fileprovider,而非不同应用不同 android:authorities -->
|
||||||
<provider
|
<!-- <provider
|
||||||
android:name=".content.TencentKitFileProvider"
|
android:name=".content.TencentKitFileProvider"
|
||||||
android:authorities="com.tencent.tauth.fileprovider"
|
android:authorities="com.tencent.tauth.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
@ -43,6 +43,6 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/tencent_kit_file_paths" />
|
android:resource="@xml/tencent_kit_file_paths" />
|
||||||
</provider>
|
</provider> -->
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -114,14 +114,21 @@ public class TencentKitPlugin implements MethodCallHandler, PluginRegistry.Activ
|
|||||||
tencent = Tencent.createInstance(appId, registrar.context().getApplicationContext());
|
tencent = Tencent.createInstance(appId, registrar.context().getApplicationContext());
|
||||||
result.success(null);
|
result.success(null);
|
||||||
} else if (METHOD_ISINSTALLED.equals(call.method)) {
|
} else if (METHOD_ISINSTALLED.equals(call.method)) {
|
||||||
boolean isQQInstalled = false;
|
boolean isInstalled = false;
|
||||||
try {
|
PackageManager packageManager = registrar.context().getPackageManager();
|
||||||
final PackageManager packageManager = registrar.context().getPackageManager();
|
List<PackageInfo> infos = packageManager.getInstalledPackages(0);
|
||||||
PackageInfo info = packageManager.getPackageInfo("com.tencent.mobileqq", 0);
|
if (infos != null && !infos.isEmpty()) {
|
||||||
isQQInstalled = info != null;
|
for (PackageInfo info : infos) {
|
||||||
} catch (PackageManager.NameNotFoundException ignore) {
|
// 普通大众版 > 办公简洁版 > 急速轻聊版
|
||||||
|
if ("com.tencent.mobileqq".equals(info.packageName)
|
||||||
|
|| "com.tencent.tim".equals(info.packageName)
|
||||||
|
|| "com.tencent.qqlite".equals(info.packageName)) {
|
||||||
|
isInstalled = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
result.success(isQQInstalled);
|
}
|
||||||
|
}
|
||||||
|
result.success(isInstalled);
|
||||||
} else if (METHOD_LOGIN.equals(call.method)) {
|
} else if (METHOD_LOGIN.equals(call.method)) {
|
||||||
login(call, result);
|
login(call, result);
|
||||||
} else if (METHOD_LOGOUT.equals(call.method)) {
|
} else if (METHOD_LOGOUT.equals(call.method)) {
|
||||||
|
@ -93,7 +93,9 @@ static NSString *const SCHEME_FILE = @"file";
|
|||||||
}
|
}
|
||||||
result(nil);
|
result(nil);
|
||||||
} else if ([METHOD_ISINSTALLED isEqualToString:call.method]) {
|
} else if ([METHOD_ISINSTALLED isEqualToString:call.method]) {
|
||||||
result([NSNumber numberWithBool:[TencentOAuth iphoneQQInstalled]]);
|
// 普通大众版 > 办公简洁版
|
||||||
|
BOOL isInstalled = [TencentOAuth iphoneQQInstalled] || [TencentOAuth iphoneTIMInstalled];
|
||||||
|
result([NSNumber numberWithBool:isInstalled]);
|
||||||
} else if ([METHOD_LOGIN isEqualToString:call.method]) {
|
} else if ([METHOD_LOGIN isEqualToString:call.method]) {
|
||||||
[self login:call result:result];
|
[self login:call result:result];
|
||||||
} else if ([METHOD_LOGOUT isEqualToString:call.method]) {
|
} else if ([METHOD_LOGOUT isEqualToString:call.method]) {
|
||||||
|
Reference in New Issue
Block a user