Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.3 KB

AUTH_BY_QR_CODE.md

File metadata and controls

49 lines (38 loc) · 1.3 KB

AUTH BY QR CODE

When WeChat not installed on devices, user can login with WeChat-QRCode.

Flutter

Request QRCode by the following codes:

fluwx.authByQRCode(
                  appId: "wxd930ea5d5a258f4f",
                  scope: "noncestr",
                  nonceStr: "nonceStr",
                  timeStamp: "1417508194",
                  signature: "429eaaa13fd71efbc3fd344d0a9a9126835e7303");
            }

What do the params mean?

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";
      });
    });
    

Android

WeChatSDK will crash due to HttpClient when running on Android P,see this solution for help .