fluwx library

Fluwx is a powerful plugin for WeChatSDK. easy to use.

A open source project authorized by OpenFlutter.

Classes

AuthByQRCodeResult
authCode is null if errorCode isn't AuthByQRCodeErrorCode.OK
WeChatAuthResponse
WeChatAutoDeductResponse
WeChatLaunchMiniProgramResponse
WeChatPaymentResponse
WeChatShareImageModel
image can't be null. if thumbnail is null or blank,fluwx will create a thumbnail through image
WeChatShareMiniProgramModel
WeChatScene is not supported here due to WeChat's limits. the default value is MINI_PROGRAM_TYPE_RELEASE [...]
WeChatShareModel
Base Class for Sharing
WeChatShareMusicModel
if musicUrl and musicLowBandUrl are both provided, only musicUrl will be used.
WeChatShareResponse
response data from WeChat.
WeChatShareTextModel
WeChatScene is not supported here due to WeChat's limits. the default value is MINI_PROGRAM_TYPE_RELEASE
WeChatShareVideoModel
if videoUrl and videoLowBandUrl are both provided, only videoUrl will be used.
WeChatShareWebPageModel
WeChatSubscribeMsgResp

Properties

onAuthByQRCodeFinished → Stream<AuthByQRCodeResult>
invoked when authByQRCode finished
read-only
onAuthGotQRCode → Stream<Uint8List>
when QRCode received
read-only
onQRCodeScanned → Stream
after uer scanned the QRCode you just received
read-only
responseFromAuth → Stream<WeChatAuthResponse>
Response from auth
read-only
responseFromAutoDeduct → Stream<WeChatAutoDeductResponse>
Response from AutoDeduct
read-only
responseFromLaunchMiniProgram → Stream<WeChatLaunchMiniProgramResponse>
read-only
responseFromPayment → Stream<WeChatPaymentResponse>
Response from payment
read-only
responseFromShare → Stream<WeChatShareResponse>
Response from share
read-only
responseFromSubscribeMsg → Stream<WeChatSubscribeMsgResp>
Response from subscribing micro-message
read-only

Functions

authByQRCode({String appId, String scope, String nonceStr, String timeStamp, String signature, String schemeData }) → Future
Sometimes WeChat is not installed on users's devices.However we can request a QRCode so that we can get AuthCode by scanning the QRCode All required params must not be null or empty schemeData only works on iOS see * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=215238808828h4XN&token=&lang=zh_CN
autoDeDuct({String appId, String mchId, String planId, String contractCode, String requestSerial, String contractDisplayAccount, String notifyUrl, String version, String sign, String timestamp, String returnApp: '3', int businessType: 12 }) → Future
please read official docs.
dispose({dynamic shareResponse: true, dynamic authResponse: true, dynamic paymentResponse: true, dynamic launchMiniProgramResponse: true, dynamic onAuthByQRCodeFinished: true, dynamic onAuthGotQRCode: true, dynamic onQRCodeScanned: true }) → void
we don't need the response any longer if params are true.
isWeChatInstalled() → Future
true if WeChat is installed,otherwise false. However,the following key-value must be added into your info.plist since iOS 9: LSApplicationQueriesSchemes weixin NSAppTransportSecurity NSAllowsArbitraryLoads <true/>
launchMiniProgram({String username, String path, WXMiniProgramType miniProgramType: WXMiniProgramType.RELEASE }) → Future
open mini-program see WXMiniProgramType
openWeChatApp() → Future<bool>
pay({String appId, String partnerId, String prepayId, String packageValue, String nonceStr, int timeStamp, String sign, String signType, String extData }) → Future
params are from server
register({String appId, bool doOnIOS: true, dynamic doOnAndroid: true, dynamic enableMTA: false }) → Future
appId is not necessary. if doOnIOS is true ,fluwx will register WXApi on iOS. if doOnAndroid is true, fluwx will register WXApi on Android.
sendAuth({String openId, String scope, String state }) → Future
The WeChat-Login is under Auth-2.0 This method login with native WeChat app. For users without WeChat app, please use authByQRCode instead This method only supports getting AuthCode,this is first step to login with WeChat Once AuthCode got, you need to request Access_Token For more information please visit: [...]
share(WeChatShareModel model) → Future
the WeChatShareModel can not be null see WeChatShareWebPageModel WeChatShareTextModel WeChatShareVideoModel WeChatShareMusicModel WeChatShareImageModel
stopAuthByQRCode() → Future
stop auth
subscribeMsg({String appId, int scene, String templateId, String reserved }) → Future
subscribe message

Enums

AuthByQRCodeErrorCode
AuthByQRCodeErrorCode.JSON_DECODE_ERR means WechatAuth_Err_GetQrcodeFailed when platform is iOS only Android will get AUTH_STOPPED
WeChatScene
WeChatScene.SESSION会话 WeChatScene.TIMELINE朋友圈 WeChatScene.FAVORITE收藏
WXMiniProgramType
WXMiniProgramType.RELEASE正式版 WXMiniProgramType.TEST测试版 WXMiniProgramType.PREVIEW预览版