Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开放没有安装手Q时候使用二维码登录参数 #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {

private void login(@NonNull MethodCall call, @NonNull Result result) {
final String scope = call.argument("scope");
final boolean qrcode = call.argument("qrcode");
if (tencent != null) {
tencent.login(activityPluginBinding.getActivity(), scope, loginListener);
tencent.login(activityPluginBinding.getActivity(), scope, loginListener, qrcode);
}
result.success(null);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/src/tencent_kit_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ class MethodChannelTencentKit extends TencentKitPlatform {
@override
Future<void> login({
required List<String> scope,
bool qrcode = false,
}) {
return methodChannel.invokeMethod<void>(
'login',
<String, dynamic>{
'scope': scope.join(','),
'qrcode': qrcode,
},
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/src/tencent_kit_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ abstract class TencentKitPlatform extends PlatformInterface {
}

/// 登录
/// qrcode 是否开启二维码登录,没有安装手Q时候使用二维码登录,一般用电视等设备。
Future<void> login({
required List<String> scope,
bool qrcode = false,
}) {
throw UnimplementedError(
'login({required scope}) has not been implemented.');
Expand Down