When WeChat not installed on devices, user can login with WeChat-QRCode.
Request QRCode by the following codes:
fluwx.authByQRCode(
appId: "wxd930ea5d5a258f4f",
scope: "noncestr",
nonceStr: "nonceStr",
timeStamp: "1417508194",
signature: "429eaaa13fd71efbc3fd344d0a9a9126835e7303");
}
You can receive the data from WeChat through these ways:
//listening your auth status
fluwx.onAuthByQRCodeFinished.listen((data){
setState(() {
_status =
"errorCode=>${data.errorCode}\nauthCode=>${data.authCode}";
});
});
//show your qrcode after this
fluwx.onAuthGotQRCode.listen((image) {
setState(() {
_image = image;
});
});
//qrcode was scanned
fluwx.onQRCodeScanned.listen((scanned) {
setState(() {
_status = "scanned";
});
});
WeChatSDK will crash due to HttpClient
when running on Android P,see this solution for help .