flutter_qq_login 0.0.2 flutter_qq_login: ^0.0.2 copied to clipboard
Flutter QQ Login Plugin
flutter_qq_login #
Flutter QQ Login Plugin
Android | iOS | |
---|---|---|
Support | SDK 19+ | 11.0+ |
Features #
This plugin has integrated the function of QQ login:
- Determine whether the QQ APP has been installed
isQQInstalled()
- The data obtained after successful login, including
OpenId
,AccessToken
and other important data - Get user information
getUserInfo()
Getting Started #
Before using this plugin, it is strongly recommended to read the official documentation in detail
Usage #
import 'package:flutter_qq_login/flutter_qq_login.dart';
// Create FlutterQqLogin
final flutterQqLogin = FlutterQqLogin();
// Initialization, please fill in the APP application ID created by QQ Internet
flutterQqLogin.init(appId: "Your APPID");
// Determine whether the QQ application is currently installed
bool isInstalled = await flutterQqLogin.isInstalled();
// Call up QQ login, return OpenId, AccessToken and other important data after successful login
Map<String, dynamic> qqInfo = await flutterQqLogin.login();
// Get user information
Map<String, dynamic> userInfo = await flutterQqLogin.getUserInfo(qqInfo['access_token'], qqInfo['openid']);
Configure Android version #
Configure android/app/build.gradle
android {
...
defaultConfig {
...
minSdkVersion 19
...
}
}
Configure android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- new content start -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- new content end -->
<application>
...
<!-- new content start -->
<activity
android:name="com.tencent.tauth.AuthActivity"
android:noHistory="true"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="Your APPID" />
</intent-filter>
</activity>
<activity
android:name="com.tencent.connect.common.AssistActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="behind"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!-- new content end -->
...
</application>
<!-- new content start -->
<queries>
<package android:name="com.tencent.mobileqq" />
</queries>
<!-- new content end -->
</manifest>
Configure iOS version #
Configure URL Types
- Use
xcode
to open your iOS projectRunner.xcworkspace
- In the
info
configuration tab underURL Types
, add a new entryidentifier
fills intencentopenapi
URL Schemes
fill intencent123456789
, where123456789
is yourAPPID
- As shown below:
Configure LSApplicationQueriesSchemes
-
Method 1, configure
info
inxcode
- Open
info
configuration, add aLSApplicationQueriesSchemes
, namelyQueried URL Schemes
- Add these items:
- mqqopensdknopasteboard
- mqqapi
- mqq
- mqqOpensdkSSoLogin
- mqqconnect
- mqqopensdkdataline
- mqqopensdkgrouptribeshare
- mqqopensdkfriend
- mqqopensdkapi
- mqqopensdkapiV2
- mqqopensdkapiV3
- mqzoneopensdk
- wtloginmqq
- wtloginmqq2
- mqqwpa
- mqzone
- mqzonev2
- mqzoneshare
- wtloginqzone
- mqzonewx
- mqzoneopensdkapiV2
- mqzoneopensdkapi19
- mqzoneopensdkapi
- mqzoneopensdk
- As shown below:
- Open
-
Method 2, modify
Info.plist
directly- Use
Android Studio
to openios/Runner/Info.plist
under the project project - Add the following configuration under the
dict
node (refer to the configuration format in the file):
- Use
<key>LSApplicationQueriesSchemes</key>
<array>
<string>mqqopensdknopasteboard</string>
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqzoneopensdk</string>
</array>
LICENSE #
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.```